public String versionDesc() { if (this.count != 0) { return MQVersion.getVersionDesc(this.version); } return ""; }
@Override public void shutdown() { super.shutdown(); } }
public synchronized void persist() { String jsonString = this.encode(true); if (jsonString != null) { String fileName = this.configFilePath(); try { MixAll.string2File(jsonString, fileName); } catch (IOException e) { log.error("persist file " + fileName + " exception", e); } } }
public static int crc32(byte[] array) { if (array != null) { return crc32(array, 0, array.length); } return 0; }
public static void printObjectProperties(final InternalLogger logger, final Object object) { printObjectProperties(logger, object, false); }
public static String getRetryTopic(String group) { if (group == null) { return null; } return MixAll.getRetryTopic(group); }
public Configuration(InternalLogger log, Object... configObjects) { this.log = log; if (configObjects == null || configObjects.length == 0) { return; } for (Object configObject : configObjects) { registerConfig(configObject); } }
protected boolean tryReleaseShared(int releases) { // Decrement count; signal when transition to zero for (; ; ) { int c = getState(); if (c == 0) return false; int nextc = c - 1; if (compareAndSetState(c, nextc)) return nextc == 0; } }
@Override public long now() { return this.systemClock.now(); }
@Override public String toString() { return "ProcessQueueInfo [commitOffset=" + commitOffset + ", cachedMsgMinOffset=" + cachedMsgMinOffset + ", cachedMsgMaxOffset=" + cachedMsgMaxOffset + ", cachedMsgCount=" + cachedMsgCount + ", cachedMsgSizeInMiB=" + cachedMsgSizeInMiB + ", transactionMsgMinOffset=" + transactionMsgMinOffset + ", transactionMsgMaxOffset=" + transactionMsgMaxOffset + ", transactionMsgCount=" + transactionMsgCount + ", locked=" + locked + ", tryUnlockTimes=" + tryUnlockTimes + ", lastLockTimestamp=" + UtilAll.timeMillisToHumanString(lastLockTimestamp) + ", droped=" + droped + ", lastPullTimestamp=" + UtilAll.timeMillisToHumanString(lastPullTimestamp) + ", lastConsumeTimestamp=" + UtilAll.timeMillisToHumanString(lastConsumeTimestamp) + "]"; } }
Sync(int count) { this.startCount = count; setState(count); }
/** * Returns the current count. * * <p>This method is typically used for debugging and testing purposes. * * @return the current count */ public long getCount() { return sync.getCount(); }
/** * Decrements the count of the latch, releasing all waiting threads if * the count reaches zero. * * <p>If the current count is greater than zero then it is decremented. * If the new count is zero then all waiting threads are re-enabled for * thread scheduling purposes. * * <p>If the current count equals zero then nothing happens. */ public void countDown() { sync.releaseShared(1); }
public void reset() { sync.reset(); }
public String getDataVersionJson() { return this.dataVersion.toJson(); }
public void stop() { this.stop(false); }
public void shutdown() { this.shutdown(false); }
protected void reset() { setState(startCount); } }