mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Standardize how ReferenceCounted resources are managed and traced, https://github.com/OpenHFT/Chronicle-Core/issues/121
This commit is contained in:
@@ -524,11 +524,11 @@ public class ReplicatedChronicleMap<K, V, R> extends VanillaChronicleMap<K, V, R
|
||||
key.writeTo(destination, destination.writePosition());
|
||||
destination.writeSkip(key.size());
|
||||
|
||||
boolean debugEnabled = LOG.isDebugEnabled();
|
||||
boolean traceEnabled = LOG.isTraceEnabled();
|
||||
String message = null;
|
||||
if (debugEnabled) {
|
||||
if (traceEnabled) {
|
||||
if (isDeleted) {
|
||||
LOG.debug("WRITING ENTRY TO DEST - into local-id={}, remove(key={})",
|
||||
LOG.trace("WRITING ENTRY TO DEST - into local-id={}, remove(key={})",
|
||||
identifier(), key);
|
||||
} else {
|
||||
message = String.format(
|
||||
@@ -545,7 +545,7 @@ public class ReplicatedChronicleMap<K, V, R> extends VanillaChronicleMap<K, V, R
|
||||
value.writeTo(destination, destination.writePosition());
|
||||
destination.writeSkip(value.size());
|
||||
|
||||
if (debugEnabled) {
|
||||
if (traceEnabled) {
|
||||
LOG.debug(message + "value=" + value + ")");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ package net.openhft.chronicle.map.impl.stage.data;
|
||||
import net.openhft.chronicle.bytes.BytesStore;
|
||||
import net.openhft.chronicle.bytes.RandomDataInput;
|
||||
import net.openhft.chronicle.core.OS;
|
||||
import net.openhft.chronicle.core.io.ReferenceOwner;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.nio.BufferOverflowException;
|
||||
@@ -37,6 +38,7 @@ public enum ZeroBytesStore implements BytesStore<ZeroBytesStore, Void> {
|
||||
throw new UnsupportedOperationException("Cannot get the address of nothing");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int peekUnsignedByte(long offset) {
|
||||
return 0;
|
||||
@@ -155,24 +157,34 @@ public enum ZeroBytesStore implements BytesStore<ZeroBytesStore, Void> {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void reserve() throws IllegalStateException {
|
||||
public void reserve(ReferenceOwner id) throws IllegalStateException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void release() throws IllegalStateException {
|
||||
public boolean tryReserve(ReferenceOwner id) throws IllegalStateException {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long refCount() {
|
||||
public boolean reservedBy(ReferenceOwner owner) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void release(ReferenceOwner id) throws IllegalStateException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void releaseLast(ReferenceOwner id) throws IllegalStateException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int refCount() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean tryReserve() {
|
||||
throw new UnsupportedOperationException("todo");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ZeroBytesStore writeByte(long l, byte b) {
|
||||
throw new UnsupportedOperationException();
|
||||
|
||||
Reference in New Issue
Block a user