HCOLL-134 creates a new map based on the details that are sent to the map of builders

This commit is contained in:
Rob Austin
2014-11-18 21:34:51 +00:00
parent 091937113d
commit ddd79cf61c
@@ -70,19 +70,23 @@ class ReplicationHubFindByName implements FindByName {
@Override
void onPut(ChronicleMap<CharSequence, ChronicleMapBuilderWithChannelId> map, Bytes
entry, int metaDataBytes, boolean added, CharSequence key,
ChronicleMapBuilderWithChannelId builder, ChronicleMapBuilderWithChannelId
ChronicleMapBuilderWithChannelId replaced, ChronicleMapBuilderWithChannelId
value, long pos, SharedSegment segment) {
super.onPut(map, entry, metaDataBytes, added, key, builder, value, pos, segment);
super.onPut(map, entry, metaDataBytes, added, key, replaced, value, pos, segment);
if (!added)
if (!added || value == null)
return;
// establish the new map based on this channel ID
LOG.info("create new map for name=" + builder.chronicleMapBuilder.name()
+ ",channelId=" + builder.channelId);
LOG.info("create new map for name=" + value.chronicleMapBuilder.name()
+ ",channelId=" + value.channelId);
try {
toReplicatedViaChannel(builder.chronicleMapBuilder, builder.channelId).create();
toReplicatedViaChannel(value.chronicleMapBuilder, value.channelId).create();
} catch (IllegalStateException e) {
// channel is already created
LOG.debug("while creating channel for name=" + value.chronicleMapBuilder.name()
+ ",channelId=" + value.channelId, e);
} catch (IOException e) {
LOG.error("", e);
}