Skip to content

Commit

Permalink
make write limit more responsive, bump tika to 2.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tballison committed Jun 16, 2023
1 parent 4d2a57d commit a3e4f8e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 18 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-core</artifactId>
<version>2.7.0</version>
<version>28.0</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,22 +88,14 @@ public void initialize(URL fxmlFileLocation, ResourceBundle resources) {
if (batchProcessConfig.getWriteLimit() > -1) {
writeLimit.setText(Long.toString(batchProcessConfig.getWriteLimit()));
}
writeLimit.focusedProperty().addListener((ov, oldV, newV) -> {
if (! newV) {
setWriteLimit();
}
});
}


public void showConfig(MouseEvent mouseEvent) {
//NO-OP for now
}

public void configureParsers(ActionEvent actionEvent) {
//NO-OP for now
}

public void configurePipesIterator(ActionEvent actionEvent) {
//NO-OP for now
}

public void setWriteLimit(ActionEvent actionEvent) {
public void setWriteLimit() {
long writeLimitVal = -1l;
if (! StringUtils.isBlank(writeLimit.getText())) {
try {
Expand All @@ -116,13 +108,11 @@ public void setWriteLimit(ActionEvent actionEvent) {
alert("Value needs to be a number", "Not a number",
">" + writeLimit.getText() + "< is not parseable as number");
writeLimit.setText("");
actionEvent.consume();
return;
} catch (ArithmeticException e) {
alert("Value out of range", "Value out of range",
"\"" + writeLimit.getText() +
"\" must be less than 9,223,372,036,854,775,807");
actionEvent.consume();
return;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,8 @@ private void appendFSPipesIterator(BatchProcessConfig batchProcessConfig,
writer.appendTextElement(params, "emitterName", "emitter");
writer.appendTextElement(params, "basePath", pipesIterator.getAttributes().get(BASE_PATH));
writer.appendTextElement(params, "countTotal", "true");
if (batchProcessConfig.getWriteLimit() > 0) {

if (batchProcessConfig.getWriteLimit() >= 0) {
writer.appendTextElement(params, "writeLimit", Long.toString(batchProcessConfig.getWriteLimit()));
}
}
Expand Down

0 comments on commit a3e4f8e

Please sign in to comment.