Skip to content
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 @@ -283,7 +283,7 @@ public void write(ByteBuffer b, int off, int len) throws IOException {
}

private void writeChunkIfNeeded() throws IOException {
if (currentBuffer.length()==0) {
if (currentBuffer.length() == 0) {
writeChunk(currentBuffer);
currentBuffer = null;
}
Expand All @@ -302,7 +302,7 @@ private void writeChunk(StreamBuffer sb) throws IOException {
}

private void allocateNewBufferIfNeeded() {
if (currentBuffer==null) {
if (currentBuffer == null) {
currentBuffer =
StreamBuffer.allocate(config.getDataStreamMinPacketSize());
}
Expand All @@ -323,7 +323,7 @@ private void doFlushIfNeeded() throws IOException {
updateFlushLength();
executePutBlock(false, false);
}
if (bufferList.size()==streamWindow){
if (bufferList.size() == streamWindow) {
try {
checkOpen();
if (!putBlockFutures.isEmpty()) {
Expand Down Expand Up @@ -514,7 +514,7 @@ private void handleFlush(boolean close)
// here, we just limit this buffer to the current position. So that next
// write will happen in new buffer

if (currentBuffer!=null) {
if (currentBuffer != null) {
writeChunk(currentBuffer);
currentBuffer = null;
}
Expand Down Expand Up @@ -693,7 +693,7 @@ private void handleInterruptedException(Exception ex,
boolean processExecutionException)
throws IOException {
LOG.error("Command execution was interrupted.");
if(processExecutionException) {
if (processExecutionException) {
handleExecutionException(ex);
} else {
throw new IOException(EXCEPTION_MSG + ex.toString(), ex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ public int position() {
}


public void put(StreamBuffer sb){
public void put(StreamBuffer sb) {
buffer.put(sb.buffer);
}

public static StreamBuffer allocate(int size){
public static StreamBuffer allocate(int size) {
return new StreamBuffer(ByteBuffer.allocate(size));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ boolean isEmpty() {
}

long computeBufferData() {
long totalDataLen =0;
for (StreamBuffer b : bufferList){
long totalDataLen = 0;
for (StreamBuffer b : bufferList) {
totalDataLen += b.position();
}
return totalDataLen;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ public OzoneDataStreamOutput createStreamKey(
.setAcls(getAclList());

if (Boolean.parseBoolean(metadata.get(OzoneConsts.GDPR_FLAG))) {
try{
try {
GDPRSymmetricKey gKey = new GDPRSymmetricKey(new SecureRandom());
builder.addAllMetadata(gKey.getKeyDetails());
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ abstract class Builder {
protected Optional<Integer> chunkSize = Optional.empty();
protected OptionalInt streamBufferSize = OptionalInt.empty();
protected Optional<Long> streamBufferFlushSize = Optional.empty();
protected Optional<Long> dataStreamBufferFlushSize= Optional.empty();
protected Optional<Long> datastreamWindowSize= Optional.empty();
protected Optional<Long> dataStreamBufferFlushSize = Optional.empty();
protected Optional<Long> datastreamWindowSize = Optional.empty();
protected Optional<Long> streamBufferMaxSize = Optional.empty();
protected OptionalInt dataStreamMinPacketSize = OptionalInt.empty();
protected Optional<Long> blockSize = Optional.empty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ protected void initializeConfiguration() throws IOException {
dataStreamBufferFlushSize = Optional.of((long) 4 * chunkSize.get());
}
if (!dataStreamMinPacketSize.isPresent()) {
dataStreamMinPacketSize = OptionalInt.of(chunkSize.get()/4);
dataStreamMinPacketSize = OptionalInt.of(chunkSize.get() / 4);
}
if (!datastreamWindowSize.isPresent()) {
datastreamWindowSize = Optional.of((long) 8 * chunkSize.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public static void init() throws Exception {
.setDataStreamBufferFlushize(maxFlushSize)
.setStreamBufferSizeUnit(StorageUnit.BYTES)
.setDataStreamMinPacketSize(chunkSize)
.setDataStreamStreamWindowSize(5*chunkSize)
.setDataStreamStreamWindowSize(5 * chunkSize)
.build();
cluster.waitForClusterToBeReady();
//the easiest way to create an open container is creating a key
Expand Down Expand Up @@ -137,7 +137,7 @@ public static void shutdown() {
@Test
public void testHalfChunkWrite() throws Exception {
testWrite(chunkSize / 2);
testWriteWithFailure(chunkSize/2);
testWriteWithFailure(chunkSize / 2);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ private FSDataOutputStream createOutputStream(String key, short replication,
boolean isRatisStreamingEnabled = getConf().getBoolean(
OzoneConfigKeys.OZONE_FS_DATASTREAM_ENABLE,
OzoneConfigKeys.OZONE_FS_DATASTREAM_ENABLE_DEFAULT);
if (isRatisStreamingEnabled){
if (isRatisStreamingEnabled) {
return new FSDataOutputStream(adapter.createStreamFile(key,
replication, overwrite, recursive), statistics);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ private FSDataOutputStream createOutputStream(String key, short replication,
boolean isRatisStreamingEnabled = getConf().getBoolean(
OzoneConfigKeys.OZONE_FS_DATASTREAM_ENABLE,
OzoneConfigKeys.OZONE_FS_DATASTREAM_ENABLE_DEFAULT);
if (isRatisStreamingEnabled){
if (isRatisStreamingEnabled) {
return new FSDataOutputStream(adapter.createStreamFile(key,
replication, overwrite, recursive), statistics);
}
Expand Down