Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding parameters to delay file processing in specific cases #2095

Merged
merged 4 commits into from
Aug 22, 2024
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 @@ -47,6 +47,9 @@ public final class VFSConstants {
public static final String TRANSPORT_FILE_LOCKING_ENABLED = "enable";
public static final String TRANSPORT_FILE_LOCKING_DISABLED = "disable";

public static final String TRANSPORT_CHECK_SIZE_INTERVAL = "transport.vfs.CheckSizeInterval";
public static final String TRANSPORT_CHECK_SIZE_IGNORE_EMPTY = "transport.vfs.CheckSizeIgnoreEmpty";

/**
* This parameter is used decide whether the resolving hostname IP of URIs are done at deployment or dynamically.
* At usage default id 'false' which lead hostname resolution at deployment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ public class PollTableEntry extends AbstractPollTableEntry {
/** moved file will have this formatted timestamp prefix */
private DateFormat moveTimestampFormat;

/** containing the time in [ms] between the size check on files (to avoid reading files which are currently written) */
private String checkSizeInterval = null;
/** does the checkSize Lock mechanisme take empty files or not, default = false */
private String checkSizeIgnoreEmpty = "false";


private boolean streaming;

private int maxRetryCount;
Expand Down Expand Up @@ -311,6 +317,30 @@ private void setMoveAfterFailure(String moveAfterFailure) throws AxisFault {
}
}

public void setCheckSizeInterval(String checkSizeInterval) {
this.checkSizeInterval = checkSizeInterval;
}

public String getCheckSizeInterval() {
return checkSizeInterval;
}

public boolean hasCheckSizeInterval() {
return (checkSizeInterval != null && checkSizeInterval.length() > 0);
}

public void setCheckSizeIgnoreEmpty(String checkSizeIgnoreEmpty) {
this.checkSizeIgnoreEmpty = checkSizeIgnoreEmpty;
}

public String getCheckSizeIgnoreEmpty() {
return checkSizeIgnoreEmpty;
}

public boolean isCheckSizeIgnoreEmpty() {
return "true".equals(checkSizeIgnoreEmpty);
}

public boolean isStreaming() {
return streaming;
}
Expand Down Expand Up @@ -609,6 +639,17 @@ protected boolean loadConfigurationsFromService(ParameterInclude params) throws
Map<String, String> schemeFileOptions = VFSUtils.parseSchemeFileOptions(fileURI, params);
setVfsSchemeProperties(schemeFileOptions);

//get check size intervall for locking
String checkSizeIntervalString = ParamUtils.getOptionalParam(params, VFSConstants.TRANSPORT_CHECK_SIZE_INTERVAL);
setCheckSizeInterval(checkSizeIntervalString);

//get check size ignore emtpy for locking
String checkSizeIgnoreEmptyString = ParamUtils.getOptionalParam(params, VFSConstants.TRANSPORT_CHECK_SIZE_IGNORE_EMPTY);
//set parameter only if it is set, default value is true
if (checkSizeIgnoreEmptyString != null) {
setCheckSizeIgnoreEmpty(checkSizeIgnoreEmptyString);
}

String strStreaming = ParamUtils.getOptionalParam(params, VFSConstants.STREAMING);
if (strStreaming != null) {
streaming = Boolean.parseBoolean(strStreaming);
Expand Down
Loading
Loading