public ReliableTopicMessage(Data payload, Address publisherAddress) { this.publishTime = Clock.currentTimeMillis(); this.publisherAddress = publisherAddress; this.payload = payload; }
TopicEvent(String name, Data data, Address publisherAddress) { this.name = name; this.publishTime = Clock.currentTimeMillis(); this.publisherAddress = publisherAddress; this.data = data; }
TopicEvent(String name, Data data, Address publisherAddress) { this.name = name; this.publishTime = Clock.currentTimeMillis(); this.publisherAddress = publisherAddress; this.data = data; }
public ReliableTopicMessage(Data payload, Address publisherAddress) { this.publishTime = Clock.currentTimeMillis(); this.publisherAddress = publisherAddress; this.payload = payload; }
@Override public void begin() throws IllegalStateException { if (state == ACTIVE) { throw new IllegalStateException("Transaction is already active"); } startTime = Clock.currentTimeMillis(); state = ACTIVE; }
@Override public void begin() throws IllegalStateException { if (state == ACTIVE) { throw new IllegalStateException("Transaction is already active"); } startTime = Clock.currentTimeMillis(); state = ACTIVE; }
void reset() { clusterServiceLock.lock(); try { joinInProgress = false; joiningMembers.clear(); timeToStartJoin = Clock.currentTimeMillis() + waitMillisBeforeJoin; firstJoinRequest = 0; } finally { clusterServiceLock.unlock(); } }
/** * Calculate and set the cluster clock diff. * * @param masterTime the cluster clock timestamp sent by the master node */ public void setMasterTime(long masterTime) { long diff = masterTime - Clock.currentTimeMillis(); setClusterTimeDiff(diff); }
private void checkTimeout() throws TransactionException { if (startTime + timeoutMillis < currentTimeMillis()) { throw new TransactionException("Transaction is timed-out!"); } }
@Override public boolean awaitUntil(Date deadline) throws InterruptedException { long until = deadline.getTime(); final long durationMs = until - Clock.currentTimeMillis(); if (durationMs <= 0) { return false; } return await(durationMs, TimeUnit.MILLISECONDS); }
@Override public void memberAdded(MembershipEvent membershipEvent) { // initialize heartbeat for newly-joined members long now = Clock.currentTimeMillis(); lastHeartbeatReceived.put(membershipEvent.getMember(), now); }
@Override public boolean contains(Data key) { long now = Clock.currentTimeMillis(); R record = records.get(key); boolean isExpired = processExpiredEntry(key, record, now); return record != null && !isExpired; }
protected boolean isRecordExpired(R record) { long now = Clock.currentTimeMillis(); if (record.isExpiredAt(now)) { return true; } else { return record.isIdleAt(maxIdleMillis, now); } }
@Override public void run() { EntryOperator operator = operator(this, backupProcessor, getPredicate()); Iterator<Record> iterator = recordStore.iterator(Clock.currentTimeMillis(), true); while (iterator.hasNext()) { Record record = iterator.next(); operator.operateOnKey(record.getKey()).doPostOperateOps(); } }
public LocalOperationStatsImpl(Node node) { this.maxVisibleSlowOperationCount = node.getProperties().getInteger(MC_MAX_VISIBLE_SLOW_OPERATION_COUNT); this.slowOperations = node.nodeEngine.getOperationService().getSlowOperationDTOs(); this.creationTime = Clock.currentTimeMillis(); }
@Override public void innerBeforeRun() throws Exception { super.innerBeforeRun(); this.begin = Clock.currentTimeMillis(); this.readOnly = entryProcessor instanceof ReadOnly; SerializationService serializationService = getNodeEngine().getSerializationService(); ManagedContext managedContext = serializationService.getManagedContext(); managedContext.initialize(entryProcessor); }
protected void prepareForNextCleanup() { CacheService service = getService(); CachePartitionSegment segment = service.getSegment(getPartitionId()); segment.setRunningCleanupOperation(false); segment.setLastCleanupTime(Clock.currentTimeMillis()); }
public StoreWorker(MapStoreContext mapStoreContext, WriteBehindProcessor writeBehindProcessor) { this.mapName = mapStoreContext.getMapName(); this.mapServiceContext = mapStoreContext.getMapServiceContext(); NodeEngine nodeEngine = mapServiceContext.getNodeEngine(); this.partitionService = nodeEngine.getPartitionService(); this.executionService = nodeEngine.getExecutionService(); this.writeBehindProcessor = writeBehindProcessor; this.backupDelayMillis = getReplicaWaitTimeMillis(); this.lastHighestStoreTime = Clock.currentTimeMillis(); this.writeDelayMillis = SECONDS.toMillis(getWriteDelaySeconds(mapStoreContext)); this.partitionCount = partitionService.getPartitionCount(); }
public StoreWorker(MapStoreContext mapStoreContext, WriteBehindProcessor writeBehindProcessor) { this.mapName = mapStoreContext.getMapName(); this.mapServiceContext = mapStoreContext.getMapServiceContext(); NodeEngine nodeEngine = mapServiceContext.getNodeEngine(); this.partitionService = nodeEngine.getPartitionService(); this.executionService = nodeEngine.getExecutionService(); this.writeBehindProcessor = writeBehindProcessor; this.backupDelayMillis = getReplicaWaitTimeMillis(); this.lastHighestStoreTime = Clock.currentTimeMillis(); this.writeDelayMillis = SECONDS.toMillis(getWriteDelaySeconds(mapStoreContext)); this.partitionCount = partitionService.getPartitionCount(); }
private void ensureBackupOperationInitialized() { if (!backupOperationInitialized) { backupOperationInitialized = true; backupOp.setNodeEngine(getNodeEngine()); backupOp.setPartitionId(getPartitionId()); backupOp.setReplicaIndex(getReplicaIndex()); backupOp.setCallerUuid(getCallerUuid()); OperationAccessor.setCallerAddress(backupOp, getCallerAddress()); OperationAccessor.setInvocationTime(backupOp, Clock.currentTimeMillis()); backupOp.setOperationResponseHandler(createEmptyResponseHandler()); } }