Skip to content

Commit

Permalink
Rename PartitionCommitter close to flush
Browse files Browse the repository at this point in the history
  • Loading branch information
electrum committed Jan 25, 2016
1 parent c03031b commit 4ed9ae5
Showing 1 changed file with 3 additions and 6 deletions.
Expand Up @@ -64,7 +64,6 @@

import javax.inject.Inject;

import java.io.Closeable;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
Expand Down Expand Up @@ -661,7 +660,7 @@ public void commitCreateTable(ConnectorSession session, ConnectorOutputTableHand
.map(partitionUpdate -> createPartition(table, partitionUpdate))
.forEach(partitionCommitter::addPartition);
}
partitionCommitter.close();
partitionCommitter.flush();
}
catch (Throwable throwable) {
partitionCommitter.abort();
Expand Down Expand Up @@ -707,7 +706,6 @@ public HiveInsertTableHandle beginInsert(ConnectorSession session, ConnectorTabl
}

private static class PartitionCommitter
implements Closeable
{
private final String schemaName;
private final String tableName;
Expand Down Expand Up @@ -738,8 +736,7 @@ public void addPartition(Partition partition)
}
}

@Override
public void close()
public void flush()
{
if (!batch.isEmpty()) {
addBatch();
Expand Down Expand Up @@ -837,7 +834,7 @@ public void commitInsert(ConnectorSession session, ConnectorInsertTableHandle in
}
}
}
partitionCommitter.close();
partitionCommitter.flush();
for (CompletableFuture<?> fileRenameFuture : fileRenameFutures) {
MoreFutures.getFutureValue(fileRenameFuture, PrestoException.class);
}
Expand Down

0 comments on commit 4ed9ae5

Please sign in to comment.