/** * Create data transfer object for baseline node. * * @param node Baseline node. */ public VisorBaselineNode(BaselineNode node) { consistentId = String.valueOf(node.consistentId()); attrs = node.attributes(); }
/** * @param nodes Nodes. * @param id ID of BaselineTopology to build. * @return Baseline topology consisting of given nodes. */ @Nullable public static BaselineTopology build(Collection<? extends BaselineNode> nodes, int id) { if (nodes == null) return null; Map<Object, Map<String, Object>> nodeMap = new HashMap<>(); for (BaselineNode node : nodes) nodeMap.put(node.consistentId(), node.attributes()); return new BaselineTopology(nodeMap, id); }
/** {@inheritDoc} */ @Override public void processOutStream(int type, BinaryRawWriterEx writer) throws IgniteCheckedException { switch (type) { case OP_GET_IGNITE_CONFIGURATION: { PlatformConfigurationUtils.writeIgniteConfiguration(writer, ignite().configuration(), CURRENT_VER); return; } case OP_GET_CACHE_NAMES: { Collection<String> names = ignite().cacheNames(); writer.writeInt(names.size()); for (String name : names) writer.writeString(name); return; } case OP_GET_BASELINE_TOPOLOGY: { Collection<BaselineNode> blt = ignite().cluster().currentBaselineTopology(); writer.writeInt(blt.size()); for (BaselineNode n : blt) { writer.writeObjectDetached(n.consistentId()); PlatformUtils.writeNodeAttributes(writer, n.attributes()); } return; } } PlatformAbstractTarget.throwUnsupported(type); }
/** * Create data transfer object for baseline node. * * @param node Baseline node. */ public VisorBaselineNode(BaselineNode node) { consistentId = String.valueOf(node.consistentId()); attrs = node.attributes(); }
/** * @param nodes Nodes. * @param id ID of BaselineTopology to build. * @return Baseline topology consisting of given nodes. */ @Nullable public static BaselineTopology build(Collection<? extends BaselineNode> nodes, int id) { if (nodes == null) return null; Map<Object, Map<String, Object>> nodeMap = new HashMap<>(); for (BaselineNode node : nodes) nodeMap.put(node.consistentId(), node.attributes()); return new BaselineTopology(nodeMap, id); }
/** {@inheritDoc} */ @Override public void processOutStream(int type, BinaryRawWriterEx writer) throws IgniteCheckedException { switch (type) { case OP_GET_IGNITE_CONFIGURATION: { PlatformConfigurationUtils.writeIgniteConfiguration(writer, ignite().configuration(), CURRENT_VER); return; } case OP_GET_CACHE_NAMES: { Collection<String> names = ignite().cacheNames(); writer.writeInt(names.size()); for (String name : names) writer.writeString(name); return; } case OP_GET_BASELINE_TOPOLOGY: { Collection<BaselineNode> blt = ignite().cluster().currentBaselineTopology(); writer.writeInt(blt.size()); for (BaselineNode n : blt) { writer.writeObjectDetached(n.consistentId()); PlatformUtils.writeNodeAttributes(writer, n.attributes()); } return; } } PlatformAbstractTarget.throwUnsupported(type); }