Generates the report of the block store delta in the last heartbeat period. Calling this method
marks the end of a period and the start of a new heartbeat period.

@return the block store delta report for the last heartbeat period
173744
public BlockHeartbeatReport generateReport() {
    synchronized (mLock) {
      BlockHeartbeatReport report
          = new BlockHeartbeatReport(mAddedBlocks, mRemovedBlocks, mLostStorage);
      // Clear added and removed blocks
      mAddedBlocks.clear();
      mRemovedBlocks.clear();
      mLostStorage.clear();
      return report;
    }
  }
1147812
@CanIgnoreReturnValue
  public final double getAndAdd(double delta) {
    while (true) {
      long current = value;
      double currentVal = longBitsToDouble(current);
      double nextVal = currentVal + delta;
      long next = doubleToRawLongBits(nextVal);
      if (updater.compareAndSet(this, current, next)) {
        return currentVal;
      }
    }
  }
1069744
protected Xid generateNewBranch() {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "generateNewBranch");

        // Create a new Xid branch
        final XidImpl result = new XidImpl(_txServiceXid, ++_branchCount);

        if (tc.isEntryEnabled())
            Tr.exit(tc, "generateNewBranch", result);
        return result;
    }
108920
private DataBlock getWriteDataBlock() throws IOException {
        if (writableBlocks.size() != 0) {
            return writableBlocks.get(0);
        }

        lock.lock();
        try {
            if (writableBlocks.size() != 0) {
                return writableBlocks.get(0);
            }
            DataBlock dataBlock = new DataBlock(storeConfig);
            NAME_BLOCK_MAP.put(dataBlock.getFileId(), dataBlock);
            writableBlocks.add(dataBlock);
            return dataBlock;
        } finally {
            lock.unlock();
        }
    }
399413
public void writeDataBlock( int blockIndex , long blockOffset , byte[] blockData ) throws JournalException
    {
    	// Refuse any further operation in case of previous failure
    	if (failing)
    		throw new JournalException("Store journal is failing");
    	
        synchronized (journalWriteQueue)
        {
        	if (traceEnabled)
        		log.trace("["+baseName+"] #"+currentTransactionId+" Queueing data block write : ["+blockIndex+"] offset="+blockOffset+" size="+blockData.length+" / queueSize="+(journalWriteQueue.size()+1));
        	
        	DataBlockWriteOperation op = 
        		new DataBlockWriteOperation(currentTransactionId,
		        							blockIndex, 
		    		                        blockOffset, 
		    		                        blockData);
            journalWriteQueue.addLast(op);
            unflushedJournalSize += op.size();
            totalPendingOperations++;
        }
    }
1274406
public int recover() throws JournalException
	{
	    int newBlockCount = -1;
	    
		log.warn("["+baseName+"] Recovery required for data store : found "+journalFiles.length+" journal file(s)");
		for (int i = 0; i < journalFiles.length; i++)
		    newBlockCount = recoverFromJournalFile(journalFiles[i]);
		
		return newBlockCount;
	}
633478
ClusterStats generateLoadReport(Duration interval) {
    ClusterStats.Builder statsBuilder = ClusterStats.newBuilder().setClusterName(clusterName)
        .setLoadReportInterval(interval);
    for (Map.Entry<Locality, XdsClientLoadRecorder.ClientLoadCounter> entry : localityLoadCounters
        .entrySet()) {
      XdsClientLoadRecorder.ClientLoadSnapshot snapshot = entry.getValue().snapshot();
      statsBuilder
          .addUpstreamLocalityStats(UpstreamLocalityStats.newBuilder()
              .setLocality(entry.getKey())
              .setTotalSuccessfulRequests(snapshot.callsSucceed)
              .setTotalErrorRequests(snapshot.callsFailed)
              .setTotalRequestsInProgress(snapshot.callsInProgress));
      // Discard counters for localities that are no longer exposed by the remote balancer and
      // no RPCs ongoing.
      if (!entry.getValue().isActive() && snapshot.callsInProgress == 0) {
        localityLoadCounters.remove(entry.getKey());
      }
    }
    for (Map.Entry<String, AtomicLong> entry : dropCounters.entrySet()) {
      statsBuilder.addDroppedRequests(DroppedRequests.newBuilder()
          .setCategory(entry.getKey())
          .setDroppedCount(entry.getValue().getAndSet(0)));
    }
    return statsBuilder.build();
  }
772082
public com.google.api.ads.admanager.axis.v201811.CanoeSyncResult getLastSyncResult() {
        return lastSyncResult;
    }
709151
public BlockStrategy getBlockStrategy() {
        return this.blockStrategy = (null == this.blockStrategy ? new BlockStrategy() {
            
            @Override public void block(long sleepTime) throws InterruptedException {
                Thread.sleep(sleepTime);
            }
        } : this.blockStrategy);
    }
112016
public String report() {
		StringBuilder sb = new StringBuilder();

		sb.append(String.format("%d CONTINUES / LINES:\n", numContinues));
		sb.append(String.format("TOTAL TIME: %s\n", formatMillisecs(continueTotal)));
		sb.append(String.format("SNAPSHOTTING: %s\n", formatMillisecs(snapTotal)));
		sb.append(String.format("OTHER: %s\n", formatMillisecs(continueTotal - (stepTotal + snapTotal))));
		sb.append(rootNode.toString());

		return sb.toString();
	}
473775
@Override
	public long blocksAccessed() {
		double rpb = (double) (Buffer.BUFFER_SIZE / RecordPage.slotSize(p.schema()));
		return (int) Math.ceil(p.recordsOutput() / rpb);
	}
478629
public static long getIdleTimeMillis() {
    long latestEndTimeMillis = -1;

    // If there are any running rapids queries, consider that not idle.
    if (activeRapidsExecs.get() > 0) {
      updateNotIdle();
    }
    else {
      // If there are any running jobs, consider that not idle.
      // Remember the latest job ending time as well.
      Job[] jobs = Job.jobs();
      for (int i = jobs.length - 1; i >= 0; i--) {
        Job j = jobs[i];
        if (j.isRunning()) {
          updateNotIdle();
          break;
        }

        if (j.end_time() > latestEndTimeMillis) {
          latestEndTimeMillis = j.end_time();
        }
      }
    }

    long latestTimeMillis = Math.max(latestEndTimeMillis, lastTimeSomethingHappenedMillis);

    // Calculate milliseconds and clamp at zero.
    long now = System.currentTimeMillis();
    long deltaMillis = now - latestTimeMillis;
    if (deltaMillis < 0) {
      deltaMillis = 0;
    }
    return deltaMillis;
  }
1184091
public Block[] getBlocksBeingWrittenReport(int namespaceId) throws IOException {
    LightWeightHashSet<Block> blockSet = new LightWeightHashSet<Block>();
    volumes.getBlocksBeingWrittenInfo(namespaceId, blockSet);
    Block blockTable[] = new Block[blockSet.size()];
    int i = 0;
      for (Iterator<Block> it = blockSet.iterator(); it.hasNext(); i++) {
    blockTable[i] = it.next();
    }
    return blockTable;
  }
676454
public long getNextUniqueId() {
        // get the current time, usually the salt value is zero
        // in testing it is used to simulate clock skew
        long currentTime = m_clock.get() + m_timestampTestingSalt;
        long currentTimePlusOffset = currentTime + m_backwardsTimeAdjustmentOffset;
        if (currentTime == lastUsedTime) {
            // increment the counter for this millisecond
            counterValue++;

            // handle the case where we've run out of counter values
            // for this particular millisecond (feels unlikely)
            if (counterValue > COUNTER_MAX_VALUE) {
                // spin until the next millisecond
                while (currentTime == lastUsedTime)
                    currentTime = m_clock.get();
                // reset the counter and lastUsedTime for the new millisecond
                lastUsedTime = currentTime;
                counterValue = 0;
            }
        }
        else {
            // reset the counter and lastUsedTime for the new millisecond
            if (currentTime < lastUsedTime && currentTimePlusOffset < lastUsedTime) {
                /*
                 * Time moved backwards, if was less than three seconds, spin to let it catch up
                 * otherwise calculate an offset to add to the system clock in order to use it to
                 * continue moving forward
                 */
                double diffSeconds = (lastUsedTime - currentTime) / 1000.0;
                // if the diff is less than some specified amount of time, wait a bit
                StringBuilder msg = new StringBuilder(256);
                if ((lastUsedTime - currentTime) < BACKWARD_TIME_FORGIVENESS_WINDOW_MS) {
                    msg.append("UniqueIdGenerator time moved backwards from: %d to %d, a difference of %.2f seconds.");
                    msg.append("\nThis node will delay any stored procedures sent to it.");
                    msg.append("\nThis node will resume full operation in  %.2f seconds.");
                    log.rateLimitedLog(60, Level.INFO, null, msg.toString(), lastUsedTime, currentTime, diffSeconds, diffSeconds );

                    long count = BACKWARD_TIME_FORGIVENESS_WINDOW_MS;
                    // note, the loop should stop once lastUsedTime is PASSED, not current
                    while ((currentTime <= lastUsedTime) && (count-- > 0)) {
                        try {
                            m_clock.sleep(1);
                        } catch (InterruptedException e) {}
                        currentTime = m_clock.get();
                    }
                    // if the loop above ended because it ran too much, time is pretty darn wonky.
                    // Going to let it crash in this instance
                    if (count < 0) {
                        VoltDB.crashLocalVoltDB("VoltDB was unable to recover after the system time was externally negatively adusted. " +
                                "It is possible that there is a serious system time or NTP error. ", false, null);
                    }
                }
                // Calculate an offset that will keep time moving forward at the rate of the system clock
                // but at the current time, not the time the system clock shifted back too.
                else {
                    m_backwardsTimeAdjustmentOffset = lastUsedTime - currentTime + 1;
                    //Since we calculated a new offset, recalculate the current time + the offset
                    currentTimePlusOffset = currentTime + m_backwardsTimeAdjustmentOffset;
                    //Should satisfy this constraint now
                    assert(currentTimePlusOffset > lastUsedTime);
                    double offsetSeconds = m_backwardsTimeAdjustmentOffset / 1000.0D;

                    msg.append("UniqueIdGenerator time moved backwards from: %d to %d, a difference of %.2f seconds.");
                    msg.append("\nContinuing operation by adding an offset of %.2f to system time. ");
                    msg.append("This means the time and unique IDs provided by VoltProcedure ");
                    msg.append(" (getUniqueId, getTransactionId, getTransactionTime) ");
                    msg.append("will not correctly reflect wall clock time as reported by the system clock.");
                    msg.append(" For severe shifts you could see duplicate ");
                    msg.append("IDs or time moving backwards when the server is");
                    msg.append(" restarted causing the offset to be discarded.");

                    log.rateLimitedLog(60, Level.ERROR, null, msg.toString(), lastUsedTime, currentTime, diffSeconds, offsetSeconds);
                }
            } else if (currentTime > lastUsedTime && m_backwardsTimeAdjustmentOffset != 0) {
                //Actual wall clock time is correct, blast away the offset
                //and switch to current time
                m_backwardsTimeAdjustmentOffset = 0;
                currentTimePlusOffset = currentTime;
                log.error("Host clock seems to have adjusted again to make the offset unecessary");
                System.err.println("Host clock seems to have adjusted again to make the offset unecessary");
            }
            currentTime = currentTimePlusOffset;
            lastUsedTime = currentTime;
            counterValue = 0;
        }

        lastUniqueId = makeIdFromComponents(currentTime, counterValue, partitionId);

        return lastUniqueId;
    }
38018
public String getReport() {
		StringBuffer info = new StringBuffer();
		if (!isCachingEnabled()) {
			info.append("cache behaviour: DISABLED\n");
		} else if (isCachingPermanent()) {
			info.append("cache behaviour: PERMANENT\n");
		} else {
			info.append("cache behaviour: NORMAL\n");
		}

		info.append("time to live: " + ttlInSeconds + " s\n");
		info.append("cleanup interval: " + cleanupInterval + " s\n");
		info.append("cache size: " + data.size() + " objects\n");
		info.append("cache mirror size: " + mirror.size() + " object(s)\n");
		info.append("cache hits: " + hits + '\n');
		info.append("cache misses: " + misses + '\n');
		info.append("cache unavailable: " + unavailable + '\n');
		info.append("cache delayed hits: " + delayedHits + '\n');
		info.append("cache delayed misses: " + delayedMisses + '\n');
		info.append("next cleanup run: " + new Date(lastRun.getTime() + (cleanupInterval * 1000)) + "\n");
		return info.toString();
	}
848465
public EndState getEndState() {
        EndState result = EndState.PASSED;
        for ( ScenarioToken s : scenarios) {
            if ( s.getEndState() == EndState.FAILED) {
                result = EndState.FAILED;
                break;
            }
        }

        if ( result != EndState.FAILED) {
            for ( ScenarioToken s : scenarios) {
                if ( s.getEndState() == EndState.PENDING) {
                    result = EndState.PENDING;
                }
            }
        }
        return result;
    }
1325566
def delta(self):
        
        completed_date = parse_api_datetime(self.batch["CompletedDate"])
        created_date = parse_api_datetime(self.batch["CreatedDate"])
        td = completed_date - created_date
        return td.total_seconds()