Skip to content
Open
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 @@ -259,24 +259,32 @@ int readRemote(long position, byte[] b, int offset, int length, boolean speculat
while (inStream.read(junkbuffer, 0, junkbuffer.length)>=0); // read and consume rest of stream, if any remains
}
} catch (IOException ex) {
throw new ADLException("Error reading data from response stream in positioned read() for file " + filename, ex);
String requestDebugDetails = getRequestDebugDetails(opts, resp,
(System.nanoTime() - start) / 1000000, totalBytesRead, position);
throw new ADLException("Error reading data from response stream in positioned read() for file " +
filename + ". Details " + requestDebugDetails, ex);
} finally {
if (inStream != null) inStream.close();
long timeTaken=(System.nanoTime() - start)/1000000;
if (log.isDebugEnabled()) {
String logline ="HTTPRequestRead," + (resp.successful?"Succeeded":"Failed") +
",cReqId:" + opts.requestid +
",lat:" + Long.toString(resp.lastCallLatency+timeTaken) +
",Reqlen:" + totalBytesRead +
",sReqId:" + resp.requestId +
",path:" + filename +
",offset:" + position;
String logline = getRequestDebugDetails(opts, resp, timeTaken, totalBytesRead, position);
log.debug(logline);
}
}
return totalBytesRead;
}

private String getRequestDebugDetails(RequestOptions reqOpts, OperationResponse resp,
long timeTaken, int totalBytesRead, long position) {
return "HTTPRequestRead," + (resp.successful?"Succeeded":"Failed") +
",cReqId:" + reqOpts.requestid +
",lat:" + Long.toString(resp.lastCallLatency+timeTaken) +
",Reqlen:" + totalBytesRead +
",sReqId:" + resp.requestId +
",path:" + filename +
",offset:" + position;
}


/**
* Seek to given position in stream.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@

/**
* Indicator flags to backend during append.
* Optionally indicates what to do after completion of the concurrent append.
* DATA indicates that more data will be sent immediately by the client, the file handle should
* remain open/locked, and file metadata (including file length, last modified time) should NOT
* get updated.
* METADATA indicates that more data will be sent immediately by the client, the file handle should
* remain open/locked, and file metadata should get updated. CLOSE indicates that the client is
* done sending data, the file handle should be closed/unlocked, and file metadata should get
* updated.
* Possible values include: 'DATA', 'METADATA', 'CLOSE'
*/
public enum SyncFlag {
/**
Expand Down