forked from apache/parquet-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PARQUET-2437: Avoid flushing at Parquet writes after an exception
- Loading branch information
1 parent
d31a891
commit 29a86b4
Showing
6 changed files
with
384 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
parquet-column/src/main/java/org/apache/parquet/column/impl/StatusManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package org.apache.parquet.column.impl; | ||
|
||
/** | ||
* Interface to manage the current error status. It is used to share the status of all the different (column, page, | ||
* etc.) writer/reader instances. | ||
*/ | ||
interface StatusManager { | ||
|
||
/** | ||
* Creates an instance of the default {@link StatusManager} implementation. | ||
* | ||
* @return the newly created {@link StatusManager} instance | ||
*/ | ||
static StatusManager create() { | ||
return new StatusManager() { | ||
private boolean aborted; | ||
|
||
@Override | ||
public void abort() { | ||
aborted = true; | ||
} | ||
|
||
@Override | ||
public boolean isAborted() { | ||
return aborted; | ||
} | ||
}; | ||
} | ||
|
||
/** | ||
* To be invoked if the current process is to be aborted. For example in case of an exception is occurred during | ||
* writing a page. | ||
*/ | ||
void abort(); | ||
|
||
/** | ||
* Returns whether the current process is aborted. | ||
* | ||
* @return {@code true} if the current process is aborted, {@code false} otherwise | ||
*/ | ||
boolean isAborted(); | ||
} |
Oops, something went wrong.