public synchronized String getMetricsReporterID() { if (metricsReporterID == null) { String mid = System.getProperty(MetricNames.METRICS_REPORTER_ID_PROP); if (mid == null) { try { String hostname = InetAddress.getLocalHost().getHostName(); int idx = hostname.indexOf('.'); if (idx > 0) { hostname = hostname.substring(0, idx); } mid = hostname + "_" + getSharedResources().getTransactorID(); } catch (UnknownHostException e) { throw new RuntimeException(e); } } metricsReporterID = mid.replace('.', '_'); } return metricsReporterID; }
public synchronized String getMetricsReporterID() { if (metricsReporterID == null) { String mid = System.getProperty(MetricNames.METRICS_REPORTER_ID_PROP); if (mid == null) { try { String hostname = InetAddress.getLocalHost().getHostName(); int idx = hostname.indexOf('.'); if (idx > 0) { hostname = hostname.substring(0, idx); } mid = hostname + "_" + getSharedResources().getTransactorID(); } catch (UnknownHostException e) { throw new RuntimeException(e); } } metricsReporterID = mid.replace('.', '_'); } return metricsReporterID; }
public synchronized TimestampTracker getTimestampTracker() { checkIfClosed(); if (tsTracker == null) { tsTracker = new TimestampTracker(env, getTransactorID()); } return tsTracker; }
public synchronized TimestampTracker getTimestampTracker() { checkIfClosed(); if (tsTracker == null) { tsTracker = new TimestampTracker(env, getTransactorID()); } return tsTracker; }
public synchronized TransactorNode getTransactorNode() { checkIfClosed(); if (tnode == null) { tnode = new TransactorNode(env, getTransactorID()); } else if (tnode.getStatus() == TrStatus.CLOSED) { throw new IllegalStateException("TransactorNode is closed!"); } return tnode; }
public synchronized TransactorNode getTransactorNode() { checkIfClosed(); if (tnode == null) { tnode = new TransactorNode(env, getTransactorID()); } else if (tnode.getStatus() == TrStatus.CLOSED) { throw new IllegalStateException("TransactorNode is closed!"); } return tnode; }
@Test public void testTransactorID() { TransactorID tid1 = new TransactorID(env); Assert.assertEquals(id1, tid1.getLongID()); Assert.assertEquals((Long) (id1 - 1), env.getSharedResources().getTransactorID().getLongID()); TransactorID tid3 = new TransactorID(env); Assert.assertEquals(id2, tid3.getLongID()); }