[For each segment tier in the chain, the first tier initially]
- Search for the slot with the extracted hash lookup key in the tier's hash lookup, using
+
Search for a slot with the extracted hash lookup key in the tier's hash lookup, using
standard search algorithm for hash tables with open addressing and collision resolution via linear
probing.
@@ -142,14 +158,15 @@ after the previous tier.* All tiers, either first in their segments or chained,
location, byte-by-byte.
,
*
* It is strongly advised not to configure {@code maxBloatFactor} to more than {@code 10.0},
* almost certainly, you either should configure {@code ChronicleHash}es completely differently,
- * or this data structure doesn't fit you case.
+ * or this data store doesn't fit to your case.
*
* @param maxBloatFactor the maximum number ot times, the created hash container is supposed
* to bloat up beyond the {@link #entries(long)}
@@ -393,19 +393,19 @@ public interface ChronicleHashBuilder,
/**
* Configures timeout after which entries, marked as removed in the Chronicle Hash, constructed
- * by this builder, are allowed to be completely removed from the data structure. In replicated
+ * by this builder, are allowed to be completely removed from the data store. In replicated
* Chronicle nodes, when {@code remove()} on the key is called, the corresponding entry
- * is not immediately erased from the data structure, to let the distributed system eventually
+ * is not immediately erased from the data store, to let the distributed system eventually
* converge on some value for this key (or converge on the fact, that this key is removed).
* Chronicle Hash watch in runtime after the entries, and if one is removed and not updated
* in any way for this {@code removedEntryCleanupTimeout}, Chronicle is allowed to remove this
- * entry completely from the data structure. This timeout should depend on your distributed
+ * entry completely from the data store. This timeout should depend on your distributed
* system topology, and typical replication latencies, that should be determined experimentally.
*
* Default timeout is 1 minute.
*
* @param removedEntryCleanupTimeout timeout, after which stale removed entries could be erased
- * from Chronicle Hash data structure completely
+ * from Chronicle Hash data store completely
* @param unit time unit, in which the timeout is given
* @return this builder back
* @throws IllegalArgumentException is the specified timeout is less than 1 millisecond
diff --git a/src/main/java/net/openhft/chronicle/hash/impl/VanillaChronicleHash.java b/src/main/java/net/openhft/chronicle/hash/impl/VanillaChronicleHash.java
index ff4ee4059..ee3bdb2f1 100644
--- a/src/main/java/net/openhft/chronicle/hash/impl/VanillaChronicleHash.java
+++ b/src/main/java/net/openhft/chronicle/hash/impl/VanillaChronicleHash.java
@@ -734,7 +734,7 @@ public abstract class VanillaChronicleHash builder = ChronicleMapBuilder
- .of(Data.class, Data.class)
+ ChronicleMapBuilder builder = ChronicleMapBuilder
+ .of(IData.Data.class, IData.Data.class)
.keyReaderAndDataAccess(new DataReader(), new DataDataAccess())
.valueReaderAndDataAccess(new DataReader(), new DataDataAccess())
.actualChunkSize(64)
.entries(1000);
- try (ChronicleMap map = newInstance(builder)) {
+ try (ChronicleMap map = newInstance(builder)) {
for (int i = 0; i < 100; i++) {
- Data key = new Data();
- Data value = new Data();
+ IData.Data key = new IData.Data();
+ IData.Data value = new IData.Data();
key.setText("key-" + i);
key.setNumber(i);
value.setNumber(i);
@@ -2685,30 +2685,30 @@ public class CHMUseCasesTest {
}
}
- private static class DataDataAccess extends BytesMarshallableDataAccess {
+ private static class DataDataAccess extends BytesMarshallableDataAccess {
public DataDataAccess() {
- super(Data.class);
+ super(IData.Data.class);
}
@Override
- protected Data createInstance() {
- return new Data();
+ protected IData.Data createInstance() {
+ return new IData.Data();
}
@Override
- public DataAccess copy() {
+ public DataAccess copy() {
return new DataDataAccess();
}
}
- private static class DataReader extends BytesMarshallableReader {
+ private static class DataReader extends BytesMarshallableReader {
public DataReader() {
- super(Data.class);
+ super(IData.Data.class);
}
@Override
- protected Data createInstance() {
- return new Data();
+ protected IData.Data createInstance() {
+ return new IData.Data();
}
}
}
@@ -2721,53 +2721,53 @@ interface IData extends BytesMarshallable {
String getText();
int getNumber();
-}
-class Data implements IData, BytesMarshallable {
- static final long MAGIC = 0x8081828384858687L;
- static final long MAGIC2 = 0xa0a1a2a3a4a5a6a7L;
+ class Data implements IData, BytesMarshallable {
+ static final long MAGIC = 0x8081828384858687L;
+ static final long MAGIC2 = 0xa0a1a2a3a4a5a6a7L;
- String text;
- int number;
+ String text;
+ int number;
- @Override
- public String getText() {
- return text;
- }
+ @Override
+ public String getText() {
+ return text;
+ }
- @Override
- public void setText(String text) {
- this.text = text;
- }
+ @Override
+ public void setText(String text) {
+ this.text = text;
+ }
- @Override
- public int getNumber() {
- return number;
- }
+ @Override
+ public int getNumber() {
+ return number;
+ }
- @Override
- public void setNumber(int number) {
- this.number = number;
- }
+ @Override
+ public void setNumber(int number) {
+ this.number = number;
+ }
- @Override
- public void readMarshallable(@NotNull Bytes in) throws IllegalStateException {
- long magic = in.readLong();
- if (magic != MAGIC)
- throw new AssertionError("Start " + Long.toHexString(magic));
- text = in.readUTFΔ();
- number = in.readInt();
- long magic2 = in.readLong();
- if (magic2 != MAGIC2)
- throw new AssertionError("End " + Long.toHexString(magic2));
- }
+ @Override
+ public void readMarshallable(@NotNull Bytes in) throws IllegalStateException {
+ long magic = in.readLong();
+ if (magic != MAGIC)
+ throw new AssertionError("Start " + Long.toHexString(magic));
+ text = in.readUTFΔ();
+ number = in.readInt();
+ long magic2 = in.readLong();
+ if (magic2 != MAGIC2)
+ throw new AssertionError("End " + Long.toHexString(magic2));
+ }
- @Override
- public void writeMarshallable(@NotNull Bytes out) {
- out.writeLong(MAGIC);
- out.writeUTFΔ(text);
- out.writeInt(number);
- out.writeLong(MAGIC2);
+ @Override
+ public void writeMarshallable(@NotNull Bytes out) {
+ out.writeLong(MAGIC);
+ out.writeUTFΔ(text);
+ out.writeInt(number);
+ out.writeLong(MAGIC2);
+ }
}
}