/* (non-Javadoc)
@see com.ibm.jaggr.service.layer.ILayerCache#dump(java.io.Writer, java.util.regex.Pattern)
355427
@Override
	public void dump(Writer writer, Pattern filter) throws IOException {
		String linesep = System.getProperty("line.separator"); //$NON-NLS-1$
		for (Map.Entry<String, ILayer> entry : cacheMap.entrySet()) {
			if (filter != null) {
				Matcher m = filter.matcher(entry.getKey());
				if (!m.find())
					continue;
			}
			writer.append("ILayer key: ").append(entry.getKey()).append(linesep); //$NON-NLS-1$
			writer.append(entry.getValue().toString()).append(linesep).append(linesep);
		}
		writer.append("Number of layer cache entires = ").append(Integer.toString(cacheMap.size())).append(linesep); //$NON-NLS-1$
		writer.append("Number of layer cache evictions = ").append(Integer.toString(numEvictions.get())).append(linesep); //$NON-NLS-1$
	}
886222
public void dump() throws InvocationException {
		if (_updated) {
			List<Counter> counters = this.getAll();
			save(counters);

			synchronized (_lock) {
				_updated = false;
				_lastDumpTime = System.currentTimeMillis();
			}
		}
	}
1205311
@Override
    public void xmlWriteOn(FormattedWriter writer) throws IOException
    {
        // Restore an un-cached message to we can dump its state
        if (msg == null)
            getJSMessage(true);

        try
        {
            if (msg != null)
            {
                writer.newLine();
                writer.taggedValue("JsMessage", msg.getClass().getName());
                writer.newLine();
                writer.taggedValue("systemMessageId", msg.getSystemMessageId());

                if (msg instanceof JsApiMessage)
                {
                    writer.newLine();
                    writer.taggedValue("APIMessageId", ((JsApiMessage) msg).getApiMessageId());
                    writer.newLine();
                    writer.taggedValue("APICorrelId", ((JsApiMessage) msg).getCorrelationId());
                }
                else
                {
                    if (msg.getApiMessageIdAsBytes() != null)
                    {
                        writer.newLine();
                        writer.taggedValue("APIMessageId", new String(msg.getApiMessageIdAsBytes()));
                    }
                    if (msg.getCorrelationIdAsBytes() != null)
                    {
                        writer.newLine();
                        writer.taggedValue("APICorrelId", new String(msg.getCorrelationIdAsBytes()));
                    }
                }

                writer.newLine();
                writer.taggedValue("putTime", new Date(msg.getTimestamp()));

                // If this MessageItem is sitting on an xmit ItemStream then we're probably
                // going to be interested in the GD data in the message.
                try
                {
                    ItemStream is = getItemStream();
                    if (is instanceof PtoPXmitMsgsItemStream)
                    {
                        writer.newLine();
                        writer.startTag("xmitData");
                        writer.indent();

                        writer.newLine();
                        writer.taggedValue("startTick", msg.getGuaranteedValueStartTick());
                        writer.newLine();
                        writer.taggedValue("endTick", msg.getGuaranteedValueEndTick());
                        writer.newLine();
                        writer.taggedValue("priority", msg.getPriority());
                        writer.newLine();
                        writer.taggedValue("reliability", msg.getReliability());
                        writer.newLine();
                        writer.taggedValue("streamId", msg.getGuaranteedStreamUUID());
                        if (msg.getRoutingDestination() != null)
                        {
                            writer.newLine();
                            writer.taggedValue("routingDestination", msg.getRoutingDestination());
                        }

                        writer.outdent();
                        writer.newLine();
                        writer.endTag("xmitData");
                    }
                } catch (SevereMessageStoreException se)
                {
                    // No FFDC code needed
                } catch (RuntimeException re)
                {
                    // No FFDC code needed
                }

                String text = null;
                //if we can easily get the text of the message then use that
                if (msg instanceof JsJmsTextMessage)
                {
                    try
                    {
                        text = ((JsJmsTextMessage) msg).getText();
                        if (text != null && text.length() > 40)
                            text = text.substring(0, 37) + "...";
                    } catch (UnsupportedEncodingException e)
                    {
                        // No FFDC code needed
                        text = "Unsupported message encoding";
                    }
                }
                else
                    text = String.valueOf(msg);

                writer.newLine();
                writer.taggedValue("data", text);
            }
        } catch (RuntimeException e)
        {
            // No FFDC code needed

            // As we're not locking the state down there's very slim chance of hitting
            // something like a NPE while we do this, we'll just catch it and ignore it
        }
    }
862074
public String dump() {
        lock.lock();
        try {
            return stream(low, hr).filter(Objects::nonNull).map(Object::toString)
              .collect(Collectors.joining(", "));
        }
        finally {
            lock.unlock();
        }
    }
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;

    }
896637
public static void dumpHex(StringBuilder s, byte[] buffer, int offset, int length) {
		dumpHex(s, ByteBuffer.wrap(buffer, offset, length));
	}
502589
public static void dump(DataSet data, PrintStream out) {
    try (Log log = Log.create(out)) {
      log.write(CallInfo.create(), data);
    }
  }
587758
public void dump(final PrintWriter out, final boolean includeDoc) {
        visitVariables(new Visitor() {
            public void visit(Variable var) {
                var.write(out, includeDoc);
            }
        });
    }
672469
public synchronized void dumpStorage(final PrintStream out) {
		if (!validState) {
			throw new InvalidStateException();
		}
		try {
			final StringBuilder sb = new StringBuilder(4096);
			sb.append("#").append("ID").append("\t").append("Node").append("\n");
			for (int i = 1; i < storageBlock; i++) {
				final Node<K, V> node = getNode(i);
				sb.append(i).append((rootIdx == i) ? "R\t" : "\t").append(node).append("\n");
				if ((i % 1000) == 0) {
					out.print(sb.toString());
					sb.setLength(0);
				}
			}
			if (sb.length() > 0) {
				out.print(sb.toString());
				sb.setLength(0);
			}
		} finally {
			releaseNodes();
		}
	}
896532
@SuppressWarnings("UnusedDeclaration") public void dump() {
    Buffer buffer = new Buffer();
    try {
      dump(buffer);
    } catch (IOException e) {
      throw new AssertionError(e);
    }
    Log.i(TAG, buffer.readUtf8());
  }
1318452
public void dumpTree(PrintStream printStream, DumpConfiguration dumpConfiguration) {
		dumpTree(printStream,tree.getRoot(),0, dumpConfiguration);
	}
952582
public void dump(Writer writer) throws IOException {
		Iterator<SaxBit> i = this.saxbits.iterator();
		while (i.hasNext()) {
			final SaxBit saxbit = i.next();
			saxbit.dump(writer);
		}
		writer.flush();
	}
1023181
public static String dump(String logDir) throws IOException {
        String path = null;
        final VoltTrace tracer = s_tracer;

        if (tracer != null) {
            final File dir = new File(logDir);
            if (!dir.getParentFile().canWrite() || !dir.getParentFile().canExecute()) {
                throw new IOException("Trace log parent directory " + dir.getParentFile().getAbsolutePath() +
                                      " is not writable");
            }
            if (!dir.exists()) {
                if (!dir.mkdir()) {
                    throw new IOException("Failed to create trace log directory " + dir.getAbsolutePath());
                }
            }

            try {
                path = tracer.write(logDir);
            } catch (Exception e) {
                s_logger.info("Unable to write trace file: " + e.getMessage(), e);
            }
        }

        return path;
    }
1359733
static void dumpConfig(final String name, final Config config, final PrintWriter printWriter) {

        if (printWriter == null) {
            throw new IllegalArgumentException("writer argument cannot be null");
        }

        printWriter.println();
        printWriter.println("^  ^  ^  ^  ^  ^  ^  ^  ^  ^  ^  ^  ^  ^  ^  ^  ^  ^  ^  ^  ^  ^  ^  ^  ^  ^  ^  ^  ^  ^");
        printWriter.println(name + " " + config.root().origin());
        printWriter.println(config.root().render(configRenderOptions));
        printWriter.flush();
    }
843640
public void dump(OutputStream out){
        hydrate();
        PrintWriter p = new PrintWriter(out);
        for(Model m : delegate){
            p.write(m.toString());
            p.write('\n');
        }
        p.flush();
    }
1022139
private void dumpJmfMessage(IncidentStream is, JMFMessage jmfMsg, Object msg) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "dumpJmfMessage");

    if (msg != null) {
      is.writeLine("Message is of class: ", msg.getClass().getName());
    }
    if (jmfMsg != null) {
      try {
        String buffer = JSFormatter.format(jmfMsg);
        is.writeLine("JMF message", buffer);
        
      } catch (Exception e) {
        // No FFDC code needed - we are FFDCing!
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "dumpJmfMessage failed: " + e);
      }
    } else
      is.writeLine("No JMF message available", "");

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "dumpJmfMessage");
  }
748192
public static void dump(DataSource dataSource, PrintStream out) {
    try (Log log = Log.create(out)) {
      log.write(CallInfo.create(), executeQuery(dataSource));
    }
  }