mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Make all ReplicatedChronicleMap fields transient
This commit is contained in:
@@ -1529,6 +1529,7 @@ public final class ChronicleMapBuilder<K, V> implements
|
||||
VanillaChronicleMap<K, ?, ?, V, ?, ?, ?> map =
|
||||
(VanillaChronicleMap<K, ?, ?, V, ?, ?, ?>) m;
|
||||
map.initTransientsFromBuilder(this);
|
||||
initTransientsFromReplication(map, singleHashReplication, channel);
|
||||
map.initBeforeMapping(fis.getChannel());
|
||||
long expectedFileLength = map.expectedFileSize();
|
||||
if (expectedFileLength != fileLength) {
|
||||
@@ -1576,6 +1577,23 @@ public final class ChronicleMapBuilder<K, V> implements
|
||||
return establishReplication(map, singleHashReplication, channel);
|
||||
}
|
||||
|
||||
private static void initTransientsFromReplication(
|
||||
VanillaChronicleMap<?, ?, ?, ?, ?, ?, ?> map,
|
||||
SingleChronicleHashReplication singleHashReplication, ReplicationChannel channel) {
|
||||
if (map instanceof ReplicatedChronicleMap) {
|
||||
AbstractReplication replication;
|
||||
if (singleHashReplication != null) {
|
||||
replication = singleHashReplication;
|
||||
} else if (channel != null) {
|
||||
replication = channel.hub();
|
||||
} else {
|
||||
replication = null;
|
||||
}
|
||||
if (replication != null)
|
||||
((ReplicatedChronicleMap) map).initTransientsFromReplication(replication);
|
||||
}
|
||||
}
|
||||
|
||||
private static <K, V> boolean trySerializeHeaderViaXStream(
|
||||
VanillaChronicleMap<K, ?, ?, V, ?, ?, ?> map, ObjectOutputStream oos)
|
||||
throws IOException {
|
||||
|
||||
Reference in New Issue
Block a user