Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ public void writeRecord(T record) {
@Override
public void close() throws IOException {
try {
writer.close();
if (writer != null) {
writer.close();
}
} catch (Exception e) {
throw new TableException("Exception in close", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,10 @@ public void writeRecord(RowData record) throws IOException {

@Override
public void close() throws IOException {
this.output.flush();
this.output.close();
if (output != null) {
this.output.flush();
this.output.close();
}
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ public void endInput() throws Exception {}
public void close() throws Exception {
try {
staticPartitions.clear();
writer.close();
if (writer != null) {
writer.close();
}
} catch (Exception e) {
throw new TableException("Exception in close", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,14 @@ public void open(MetricConfig metricConfig) {

@Override
public void close() {
logRecordProcessor.forceFlush();
logRecordProcessor.close();
logRecordExporter.flush();
logRecordExporter.close();
if (logRecordProcessor != null) {
logRecordProcessor.forceFlush();
logRecordProcessor.close();
}
if (logRecordExporter != null) {
logRecordExporter.flush();
logRecordExporter.close();
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,11 @@ public void open(MetricConfig metricConfig) {

@Override
public void close() {
exporter.flush();
waitForLastReportToComplete();
exporter.close();
if (exporter != null) {
exporter.flush();
waitForLastReportToComplete();
exporter.close();
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,14 @@ public void open(MetricConfig metricConfig) {

@Override
public void close() {
spanProcessor.forceFlush();
spanProcessor.close();
spanExporter.flush();
spanExporter.close();
if (spanProcessor != null) {
spanProcessor.forceFlush();
spanProcessor.close();
}
if (spanExporter != null) {
spanExporter.flush();
spanExporter.close();
}
}

private void notifyOfAddedSpanInternal(Span span, io.opentelemetry.api.trace.Span parent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,18 @@ public void write(RowData element) {
}

public void close() throws Exception {
arrowStreamWriter.end();
arrowStreamReader.close();
rootWriter.close();
allocator.close();
if (arrowStreamWriter != null) {
arrowStreamWriter.end();
}
if (arrowStreamReader != null) {
arrowStreamReader.close();
}
if (rootWriter != null) {
rootWriter.close();
}
if (allocator != null) {
allocator.close();
}
}

/** Creates an {@link ArrowWriter}. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ public void open() throws Exception {
@Override
public void close() throws Exception {
super.close();
windowsGrouping.close();
if (windowsGrouping != null) {
windowsGrouping.close();
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ public MethodHandle open(FunctionContext context) {
@Override
public void close() {
try {
instance.close();
if (instance != null) {
instance.close();
}
} catch (Exception e) {
throw new TableException(
String.format(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ private void processCurrentData() throws Exception {
@Override
public void close() throws Exception {
super.close();
this.currentData.close();
if (this.currentData != null) {
this.currentData.close();
}
}
}