@Override public String apply(UUID id) { return U.id8(id); } })) +
@Override public String apply(UUID id) { return U.id8(id); } })) +
/** * @param sock Socket. * @param clientNodeId Node ID. * @param log Logger. */ private ClientMessageWorker(Socket sock, UUID clientNodeId, IgniteLogger log) { super("tcp-disco-client-message-worker-[" + U.id8(clientNodeId) + ' ' + sock.getInetAddress().getHostAddress() + ":" + sock.getPort() + ']', log, Math.max(spi.metricsUpdateFreq, 10), null); this.sock = sock; this.clientNodeId = clientNodeId; lastMetricsUpdateMsgTime = U.currentTimeMillis(); }
/** * Attaches node ID to log file name. * * @param nodeId Node ID. * @param fileName File name. * @return File name with node ID. */ @SuppressWarnings("IfMayBeConditional") public static String nodeIdLogFileName(UUID nodeId, String fileName) { assert nodeId != null; assert fileName != null; fileName = GridFilenameUtils.separatorsToSystem(fileName); int dot = fileName.lastIndexOf('.'); if (dot < 0 || dot == fileName.length() - 1) return fileName + '-' + U.id8(nodeId); else return fileName.substring(0, dot) + '-' + U.id8(nodeId) + fileName.substring(dot); }
/** {@inheritDoc} */ @Override public String toString() { return S.toString(GridDhtPartitionExchangeId.class, this, "nodeId", U.id8(nodeId), "evt", U.gridEventName(evt)); } }
/** {@inheritDoc} */ @Override public String shortDisplay() { return name() + ": near=" + near + ", key=" + key + ", hasNewVal=" + hasNewVal + ", hasOldVal=" + hasOldVal + ", nodeId8=" + U.id8(node().id()); }
/** {@inheritDoc} */ @Override public void setNodeId(UUID nodeId) { A.notNull(nodeId, "nodeId"); this.nodeId = nodeId; // Set nodeId as system variable to be used at configuration. System.setProperty(NODE_ID, U.id8(nodeId)); if (inited) { final LoggerContext ctx = impl.getContext(); synchronized (mux) { inited = false; } addConsoleAppenderIfNeeded(new C1<Boolean, Logger>() { @Override public Logger apply(Boolean init) { if (init) ctx.reconfigure(); return (Logger)LogManager.getRootLogger(); } }); } }
/** {@inheritDoc} */ @Override protected Map<? extends ComputeJob, ClusterNode> map0(List<ClusterNode> subgrid, @Nullable VisorTaskArgument<VisorQueryCleanupTaskArg> arg) { Set<UUID> nodeIds = taskArg.getQueryIds().keySet(); if (nodeIds.isEmpty()) throw new VisorClusterGroupEmptyException("Nothing to clear. List with node IDs is empty!"); Map<ComputeJob, ClusterNode> map = U.newHashMap(nodeIds.size()); try { for (ClusterNode node : subgrid) if (nodeIds.contains(node.id())) map.put(new VisorQueryCleanupJob(taskArg.getQueryIds().get(node.id()), debug), node); if (map.isEmpty()) { StringBuilder notFoundNodes = new StringBuilder(); for (UUID nid : nodeIds) notFoundNodes.append((notFoundNodes.length() == 0) ? "" : ",").append(U.id8(nid)); throw new VisorClusterGroupEmptyException("Failed to clear query results. Nodes are not available: [" + notFoundNodes + "]"); } return map; } finally { if (debug) logMapped(ignite.log(), getClass(), map.values()); } }
/** {@inheritDoc} */ @Override public String shortDisplay() { return name() + ": id8=" + U.id8(evtNode.id()) + ", ip=" + F.first(evtNode.addresses()); }
/** {@inheritDoc} */ @Override public String toString() { return S.toString(DiscoveryEvent.class, this, "nodeId8", U.id8(node().id()), "msg", message(), "type", name(), "tstamp", timestamp()); } }
/** {@inheritDoc} */ @Override public String toString() { return S.toString(TaskEvent.class, this, "nodeId8", U.id8(node().id()), "msg", message(), "type", name(), "tstamp", timestamp()); } }
/** {@inheritDoc} */ @Override public String toString() { return S.toString(JobEvent.class, this, "nodeId8", U.id8(node().id()), "msg", message(), "type", name(), "tstamp", timestamp()); } }
/** {@inheritDoc} */ @Override public String toString() { return S.toString(DeploymentEvent.class, this, "nodeId8", U.id8(node().id()), "msg", message(), "type", name(), "tstamp", timestamp()); } }
/** {@inheritDoc} */ @Override public String toString() { return S.toString(CacheQueryExecutedEvent.class, this, "nodeId8", U.id8(node().id()), "msg", message(), "type", name(), "tstamp", timestamp()); } }
/** {@inheritDoc} */ @Override public String toString() { return S.toString(CheckpointEvent.class, this, "nodeId8", U.id8(node().id()), "msg", message(), "type", name(), "tstamp", timestamp()); } }
/** {@inheritDoc} */ @Override public String toString() { return S.toString(CacheQueryReadEvent.class, this, "nodeId8", U.id8(node().id()), "msg", message(), "type", name(), "tstamp", timestamp()); } }
/** {@inheritDoc} */ @Override public String toString() { return S.toString(CacheRebalancingEvent.class, this, "discoEvtName", discoveryEventName(), "nodeId8", U.id8(node().id()), "msg", message(), "type", name(), "tstamp", timestamp()); } }
/** * JUnit. */ @Test public void testToString() { IgniteUuid id1 = IgniteUuid.randomUuid(); String id8_1 = U.id8(id1); info("ID1: " + id1); info("ID8_1: " + id8_1); String s = id1.toString(); IgniteUuid id2 = IgniteUuid.fromString(s); String id8_2 = U.id8(id2); info("ID2: " + id2); info("ID8_2: " + id8_2); assertNotNull(id2); assertNotNull(id8_1); assertNotNull(id8_2); assertEquals(8, id8_1.length()); assertEquals(8, id8_2.length()); assertEquals(id1, id2); assertEquals(id8_1, id8_2); }
/** * @param log Logger. * @throws Exception If failed. */ private void doServerLogTest(MockLogger log) throws Exception { String nodeId8; try { Ignite server = startGrid("server"); nodeId8 = U.id8(server.cluster().localNode().id()); setLogger(log, server); Ignite server1 = startGrid("server1"); waitForDiscovery(server, server1); } finally { stopAllGrids(); } assertTrue(F.forAny(log.logs(), new IgnitePredicate<String>() { @Override public boolean apply(String s) { return s.contains("Topology snapshot [ver=2, locNode=" + nodeId8 + ", servers=2, clients=0,") || (s.contains(">>> Number of server nodes: 2") && s.contains(">>> Number of client nodes: 0")); } })); }