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 @@ -230,7 +230,7 @@ public enum ChecksumCombineMode {
"list rather than full chunk list to optimize performance. " +
"Critical to HBase.",
tags = ConfigTag.CLIENT)
private boolean incrementalChunkList = false;
private boolean incrementalChunkList = true;

@PostConstruct
private void validate() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ public final class ScmConfigKeys {
"32KB";

public static final String OZONE_CHUNK_LIST_INCREMENTAL =
"ozone.chunk.list.incremental";
public static final boolean OZONE_CHUNK_LIST_INCREMENTAL_DEFAULT = false;
"ozone.incremental.chunk.list";
public static final boolean OZONE_CHUNK_LIST_INCREMENTAL_DEFAULT = true;

public static final String OZONE_SCM_CONTAINER_LAYOUT_KEY =
"ozone.scm.container.layout";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public final class OzoneConfigKeys {
public static final String OZONE_FS_HSYNC_ENABLED
= "ozone.fs.hsync.enabled";
public static final boolean OZONE_FS_HSYNC_ENABLED_DEFAULT
= false;
= true;

/**
* hsync lease soft limit.
Expand Down
6 changes: 3 additions & 3 deletions hadoop-hdds/common/src/main/resources/ozone-default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -856,8 +856,8 @@
</description>
</property>
<property>
<name>ozone.chunk.list.incremental</name>
<value>false</value>
<name>ozone.incremental.chunk.list</name>
<value>true</value>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jojochuang , I would suggest to change the "ozone.chunk.list.incremental" to "ozone.incremental.chunk.list",

to be consist with another property name "ozone.client.incremental.chunk.list".

<tag>OZONE, CLIENT, DATANODE, PERFORMANCE</tag>
<description>
By default, a writer client sends full chunk list of a block when it
Expand Down Expand Up @@ -4116,7 +4116,7 @@

<property>
<name>ozone.fs.hsync.enabled</name>
<value>false</value>
<value>true</value>
<tag>OZONE, CLIENT</tag>
<description>
Enable hsync/hflush. By default they are disabled.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@

import static org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.Result.BCSID_MISMATCH;
import static org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.Result.UNKNOWN_BCSID;
import static org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.Result.UNSUPPORTED_REQUEST;
import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_CHUNK_LIST_INCREMENTAL;
import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_CHUNK_LIST_INCREMENTAL_DEFAULT;

Expand All @@ -66,6 +65,7 @@ public class BlockManagerImpl implements BlockManager {
// Default Read Buffer capacity when Checksum is not present
private final int defaultReadBufferCapacity;
private final int readMappedBufferThreshold;
private boolean incrementalEnabled;

/**
* Constructs a Block Manager.
Expand All @@ -81,6 +81,15 @@ public BlockManagerImpl(ConfigurationSource conf) {
this.readMappedBufferThreshold = config.getBufferSize(
ScmConfigKeys.OZONE_CHUNK_READ_MAPPED_BUFFER_THRESHOLD_KEY,
ScmConfigKeys.OZONE_CHUNK_READ_MAPPED_BUFFER_THRESHOLD_DEFAULT);
incrementalEnabled =
config.getBoolean(OZONE_CHUNK_LIST_INCREMENTAL,
OZONE_CHUNK_LIST_INCREMENTAL_DEFAULT);
if (incrementalEnabled && !VersionedDatanodeFeatures.isFinalized(
HDDSLayoutFeature.HBASE_SUPPORT)) {
LOG.warn("DataNode has not finalized upgrading to a version that " +
"supports incremental chunk list. Fallback to full chunk list");
incrementalEnabled = false;
}
}

@Override
Expand All @@ -93,23 +102,12 @@ public long putBlock(Container container, BlockData data,
boolean endOfBlock) throws IOException {
return persistPutBlock(
(KeyValueContainer) container,
data,
config,
endOfBlock);
data, endOfBlock);
}

public static long persistPutBlock(KeyValueContainer container,
BlockData data, ConfigurationSource config, boolean endOfBlock)
public long persistPutBlock(KeyValueContainer container,
BlockData data, boolean endOfBlock)
throws IOException {
boolean incrementalEnabled =
config.getBoolean(OZONE_CHUNK_LIST_INCREMENTAL,
OZONE_CHUNK_LIST_INCREMENTAL_DEFAULT);
if (incrementalEnabled && !VersionedDatanodeFeatures.isFinalized(
HDDSLayoutFeature.HBASE_SUPPORT)) {
throw new StorageContainerException("DataNode has not finalized " +
"upgrading to a version that supports incremental chunk list.",
UNSUPPORTED_REQUEST);
}
Preconditions.checkNotNull(data, "BlockData cannot be null for put " +
"operation.");
Preconditions.checkState(data.getContainerID() >= 0, "Container Id " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
import org.apache.hadoop.ozone.container.keyvalue.KeyValueContainerData;
import org.apache.hadoop.ozone.container.keyvalue.impl.BlockManagerImpl;
import org.apache.hadoop.ozone.container.keyvalue.impl.ChunkManagerFactory;
import org.apache.hadoop.ozone.container.keyvalue.interfaces.BlockManager;
import org.apache.hadoop.ozone.container.keyvalue.interfaces.ChunkManager;

import com.codahale.metrics.Timer;
Expand Down Expand Up @@ -111,6 +110,7 @@ public class GeneratorDatanode extends BaseGenerator {
private int overlap;

private ChunkManager chunkManager;
private BlockManagerImpl blockManager;

private RoundRobinVolumeChoosingPolicy volumeChoosingPolicy;

Expand All @@ -133,7 +133,7 @@ public Void call() throws Exception {

config = createOzoneConfiguration();

BlockManager blockManager = new BlockManagerImpl(config);
blockManager = new BlockManagerImpl(config);
chunkManager = ChunkManagerFactory
.createChunkManager(config, blockManager, null);

Expand Down Expand Up @@ -286,7 +286,7 @@ public void generateData(long index) throws Exception {
writtenBytes += currentChunkSize;
}

BlockManagerImpl.persistPutBlock(container, blockData, config, true);
blockManager.persistPutBlock(container, blockData, true);

}

Expand Down