Dump the ServiceCache to CacheDumpLogger Logger.

@return
true if dump complete.
435297
private boolean dumpCache(){
        if (CacheDumpLogger.isDebugEnabled()) {
            try {
                List<ModelService> services = new ArrayList<ModelService>();
                services.addAll(getCache().values());
                StringBuilder sb = new StringBuilder();
                sb.append("LookupManager dumpped Service Cache at: ").append(System.currentTimeMillis()).append("\n");
                for (ModelService service : services) {
                    sb.append(new String(serialize(service))).append("\n");
                }
                CacheDumpLogger.debug(sb.toString());
            } catch (Exception e) {
                LOGGER.warn("Dump Service Cache failed. Set Logger {} to INFO to disable this message.",
                            CacheDumpLogger.getName());
                if (LOGGER.isTraceEnabled()) {
                    LOGGER.trace("Dump Service Cache failed. ", e);
                }
                return false;
            }
            return true;
        }
        return false;

    }
1149467
public boolean hasCache() {
        if (isCache()) {
            return true;
        }
        if (CommonUtils.isNotEmpty(methods)) {
            for (MethodConfig methodConfig : methods.values()) {
                if (CommonUtils.isTrue(methodConfig.getCache())) {
                    return true;
                }
            }
        }
        return false;
    }
59644
public void flushTxLog() {
        synchronized (flushCompleteSignal) {
            BufferName enqueueBuffer;
            synchronized (txLogToVEBuf.getPot()) {
                // Enqueue the backup task
                enqueueBuffer = txLogToVEBuf.getEnqueueBuffer(); 
                FlushNowJob flushJob = new FlushNowJob();
                txLogToVEBuf.addAndExecuteWork(flushJob);
            }
            
            try {
                do {
                    log.debug("Waiting for flush to complete in buffer {}", enqueueBuffer);
                    flushCompleteSignal.wait();
                    log.debug("Flush complete in buffer {}", lastFlushedBuffer);
                } while (lastFlushedBuffer != enqueueBuffer);
            } catch (InterruptedException e) {
                BitsyException toThrow = new BitsyException(BitsyErrorCodes.FLUSH_INTERRUPTED, "Exception while waiting for a transaction-log flush to be performed", e);

                log.error("Error while flushing the transaction log", toThrow);

                throw toThrow;
            }
        }        
    }
188595
def dumpcache(self):
		''' '''
		if cached.cacheloaded:
			#pprint.pprint(cached.cache)
			MyPrettyPrinter().pprint(cached.cache)
			return const.ENoError
		else:
			perr("Cache not loaded.")
			return const.ECacheNotLoaded
888246
protected function doExecute()
    {
        $cachePath = $this->getOption('cache_path', WINDWALKER_CACHE);

        $sum = md5(uniqid($this->console->get('system.secret')));

        File::write($cachePath . '/asset/MD5SUM', $sum);

        $this->out('Create SUM: <info>' . $sum . '</info> at <info>' . $cachePath . '/asset/MD5SUM</info>');

        return true;
    }
1012908
public function flush() {
    $request = new MemcacheFlushRequest();
    $response = new MemcacheFlushResponse();

    try {
      ApiProxy::makeSyncCall('memcache', 'FlushAll', $request, $response);
    } catch (Error $e) {
      return false;
    }
    return true;
  }
839322
private void dumpCache(){
        if (CacheDumpLogger.isDebugEnabled()) {
            try {
                StringBuilder sb = new StringBuilder();
                sb.append("LookupManager dumped Service Cache at: ").append(System.currentTimeMillis()).append("\n");
                ModelService service = getData();
                sb.append(service==null ? "Cache is empty" : new String(serialize(service))).append("\n");
                CacheDumpLogger.debug(sb.toString());
            } catch (Exception e) {
                LOGGER.warn("Dump Service Cache failed. Set Logger {} to INFO to disable this message.",
                            CacheDumpLogger.getName());
                LOGGER.trace("Dump Service Cache failed. ", e);
            }
        }
    }
1281937
boolean closeForBackup() {

        if (filesReadOnly) {
            return false;
        }

        deleteNewAndOldFiles();

        try {
            writeScript(false);
        } catch (HsqlException e) {
            deleteNewScript();

            return false;
        }

        if (cache != null) {
            try {
                cache.close(true);
                cache.backupFile();
            } catch (Exception e) {

                // backup failed perhaps due to lack of disk space
                deleteNewScript();
                deleteNewBackup();

                try {
                    if (!cache.isFileOpen()) {
                        cache.open(false);
                    }
                } catch (Exception e1) {}

                return false;
            }
        }

        try {
            properties.setDBModified(HsqlDatabaseProperties.FILES_NEW);
            closeLog();
        } catch (Exception e) {}

        deleteLog();
        renameNewScript();
        renameNewBackup();

        try {
            properties.setDBModified(
                HsqlDatabaseProperties.FILES_NOT_MODIFIED);
        } catch (Exception e) {}

        return true;
    }
1221279
public String dumpDatanode() {
    StringBuffer buffer = new StringBuffer();
    long c = getCapacity();
    long r = getRemaining();
    long u = getDfsUsed();
    buffer.append(name);
    if (!NetworkTopology.DEFAULT_RACK.equals(location)) {
      buffer.append(" "+location);
    }
    if (isDecommissioned()) {
      buffer.append(" DD");
    } else if (isDecommissionInProgress()) {
      buffer.append(" DP");
    } else {
      buffer.append(" IN");
    }
    buffer.append(" " + c + "(" + StringUtils.byteDesc(c)+")");
    buffer.append(" " + u + "(" + StringUtils.byteDesc(u)+")");
    buffer.append(" " + StringUtils.limitDecimalTo2(((1.0*u)/c)*100)+"%");
    buffer.append(" " + r + "(" + StringUtils.byteDesc(r)+")");
    buffer.append(" " + new Date(lastUpdate));
    return buffer.toString();
  }
1276857
protected function doExecute()
    {
        $folders = $this->io->getArguments();

        if (!count($folders)) {
            $this->clearCacheRoot();
        } else {
            foreach ($folders as $folder) {
                $this->clearCacheFolder($folder);
            }
        }

        $this->out('Cache cleared.');

        return true;
    }
1110281
boolean flush() {
    if (!dirty)
      return true;

    acquireExclusiveLock();
    try {

      final long timer = OProfiler.getInstance().startChrono();

      // FORCE THE WRITE OF THE BUFFER
      for (int i = 0; i < FORCE_RETRY; ++i) {
        try {
          buffer.force();
          dirty = false;
          break;
        } catch (Exception e) {
          OLogManager.instance().debug(this,
              "Cannot write memory buffer to disk. Retrying (" + (i + 1) + "/" + FORCE_RETRY + ")...");
          OMemoryWatchDog.freeMemory(FORCE_DELAY);
        }
      }

      if (dirty)
        OLogManager.instance().debug(this, "Cannot commit memory buffer to disk after %d retries", FORCE_RETRY);
      else
        OProfiler.getInstance().updateCounter("system.file.mmap.pagesCommitted", 1);

      OProfiler.getInstance().stopChrono("system.file.mmap.commitPages", timer);

      return !dirty;

    } finally {
      releaseExclusiveLock();
    }
  }
535287
public void storeCache() {
        if (cacheOk && cacheRes != null && isDirty) {
            OutputStream out = null;
            try {
                out = cacheRes.putStream();
                PrintWriter writer = new PrintWriter(new OutputStreamWriter(out, "UTF-8"));
                for (SubsystemFeatureDefinitionImpl entry : cachedFeatures.values()) {
                    ImmutableAttributes imAttrs = entry.getImmutableAttributes();
                    ProvisioningDetails provDetails = entry.getProvisioningDetails();

                    if (imAttrs != null && provDetails != null) {
                        FeatureDefinitionUtils.writeAttributes(imAttrs,
                                                               provDetails,
                                                               writer);
                    } else {
                        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                            Tr.debug(tc, "Unable to write out " + entry.getFeatureName() + " to cache because the provisioning "
                                         + "detail: " + provDetails + " or imAttrs: " + imAttrs + " is null");
                        }
                    }
                }
                writer.write("@=");
                writer.write(toFeatureNameList(installedFeatures));
                writer.write(FeatureDefinitionUtils.NL);
                writer.write("-@");
                writer.write(toFeatureNameList(configuredFeatures));
                writer.write(FeatureDefinitionUtils.NL);
                writer.write("-#");
                writer.write(configurationError ? '1' : '0');
                writer.write(FeatureDefinitionUtils.NL);

                for (Map.Entry<File, BadFeature> entry : knownBadFeatures.entrySet()) {
                    writer.write("XX");
                    writeBadManifestEntry(writer, entry.getKey(), entry.getValue());
                    writer.write(FeatureDefinitionUtils.NL);
                }

                writer.flush();
                writer.close();

                isDirty = false; // mark cache as current after it has been saved
            } catch (IOException e) {
                cacheWarning(e);
            } finally {
                FeatureDefinitionUtils.tryToClose(out);
            }
        }
    }
151836
@Override
	public void dumpCache(Writer writer, Pattern filter) throws IOException {
		_cache.get().dump(writer, filter);
	}
964702
@Override
  public void dump(DumperContext dumpContext) throws DumpException {
    ensureInitialized();
    List<String> args = dumpContext.getArgsAsList();
    PrintStream writer = dumpContext.getStdout();

    String cmd = args.isEmpty() ? null : args.get(0);
    List<String> rest = args.isEmpty() ? new ArrayList<String>() : args.subList(1, args.size());

    if (cmd != null && cmd.equals("memcache")) {
      memcache(writer, rest);
    } else if (cmd != null && cmd.equals("diskcache")) {
      diskcache(mMainFileCache, "Main", writer, rest);
      diskcache(mSmallFileCache, "Small", writer, rest);
    } else {
      usage(writer);
      if (TextUtils.isEmpty(cmd)) {
        throw new DumpUsageException("Missing command");
      } else {
        throw new DumpUsageException("Unknown command: " + cmd);
      }
    }
  }
568039
public String dump() {
    final float maxMem = Runtime.getRuntime().maxMemory() / 1000000f;
    final float totMem = Runtime.getRuntime().totalMemory() / 1000000f;
    final float freeMem = maxMem - totMem;

    final long now = System.currentTimeMillis();

    final StringBuilder buffer = new StringBuilder();
    buffer.append("\nOrientDB profiler dump of ");
    buffer.append(new Date(now));
    buffer.append(" after ");
    buffer.append((now - recording) / 1000);
    buffer.append(" secs of profiling");
    buffer.append(String.format("\nFree memory: %2.2fMb (%2.2f%%) - Total memory: %2.2fMb - Max memory: %2.2fMb - CPUs: %d",
        freeMem, (freeMem * 100 / (float) maxMem), totMem, maxMem, Runtime.getRuntime().availableProcessors()));
    buffer.append("\n");
    buffer.append(dumpHookValues());
    buffer.append("\n");
    buffer.append(dumpCounters());
    buffer.append("\n\n");
    buffer.append(dumpStats());
    buffer.append("\n\n");
    buffer.append(dumpChronos());
    return buffer.toString();
  }
884209
private boolean hasBacklog()
    {
        final long cursor = ringBuffer.getCursor();
        for (final Sequence consumer : consumerRepository.getLastSequenceInChain(false))
        {
            if (cursor > consumer.get())
            {
                return true;
            }
        }
        return false;
    }
546813
@Override
    public String dump() {
        final StringBuilder builder = new StringBuilder();
        if (mExecutor instanceof ThreadPoolExecutor) {
            // thread pool info
            final ThreadPoolExecutor executor = (ThreadPoolExecutor) mExecutor;
            final int corePoolSize = executor.getCorePoolSize();
            final int poolSize = executor.getPoolSize();
            final int activeCount = executor.getActiveCount();
            final long taskCount = executor.getTaskCount();
            final long completedCount = executor.getCompletedTaskCount();
            final boolean isShutdown = executor.isShutdown();
            final boolean isTerminated = executor.isTerminated();
            builder.append(TAG).append("[ ");
            builder.append("ThreadPool:{")
                    .append(" coreSize:").append(corePoolSize).append(";")
                    .append(" poolSize:").append(poolSize).append(";")
                    .append(" isShutdown:").append(isShutdown).append(";")
                    .append(" isTerminated:").append(isTerminated).append(";")
                    .append(" activeCount:").append(activeCount).append(";")
                    .append(" taskCount:").append(taskCount).append(";")
                    .append(" completedCount:").append(completedCount).append(";")
                    .append("}\n");
        } else {
            // thread pool info
            final ExecutorService executor = mExecutor;
            final boolean isShutdown = executor.isShutdown();
            final boolean isTerminated = executor.isTerminated();
            builder.append(TAG).append("[ ");
            builder.append("ThreadPool:{")
                    .append(" isShutdown:").append(isShutdown).append(";")
                    .append(" isTerminated:").append(isTerminated).append(";")
                    .append("}\n");
        }
        // group map
        final Map<String, List<String>> callerMap = mGroups;
        builder.append("Groups:{");
        for (Map.Entry<String, List<String>> entry : callerMap.entrySet()) {
            builder.append(" group:").append(entry.getKey())
                    .append(", tags:").append(ThreadUtils.toString(entry.getValue())).append(";");
        }
        builder.append("}\n");
        builder.append("]");

        // task map
        Map<String, ITaskRunnable> taskMap = mTasks;
        builder.append("Tasks:{");
        for (Map.Entry<String, ITaskRunnable> entry : taskMap.entrySet()) {
            builder.append(" tag:").append(entry.getKey())
                    .append(", runnable:").append(entry.getValue()).append(";");
        }
        builder.append("}\n");

        final String info = builder.toString();
        Log.v(TAG, info);
        return info;
    }