blob: f10f1aa9d85832a4e1e7e895c33b55016825985e [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_292) on Tue Jun 15 06:00:45 GMT 2021 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>RollingFileSystemSink (Apache Hadoop Main 3.3.1 API)</title>
<meta name="date" content="2021-06-15">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="RollingFileSystemSink (Apache Hadoop Main 3.3.1 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/RollingFileSystemSink.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/hadoop/metrics2/sink/KafkaSink.html" title="class in org.apache.hadoop.metrics2.sink"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/hadoop/metrics2/sink/StatsDSink.html" title="class in org.apache.hadoop.metrics2.sink"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/hadoop/metrics2/sink/RollingFileSystemSink.html" target="_top">Frames</a></li>
<li><a href="RollingFileSystemSink.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.hadoop.metrics2.sink</div>
<h2 title="Class RollingFileSystemSink" class="title">Class RollingFileSystemSink</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.hadoop.metrics2.sink.RollingFileSystemSink</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="https://docs.oracle.com/javase/8/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html?is-external=true" title="class or interface in java.lang">AutoCloseable</a>, <a href="../../../../../org/apache/hadoop/metrics2/MetricsPlugin.html" title="interface in org.apache.hadoop.metrics2">MetricsPlugin</a>, <a href="../../../../../org/apache/hadoop/metrics2/MetricsSink.html" title="interface in org.apache.hadoop.metrics2">MetricsSink</a></dd>
</dl>
<hr>
<br>
<pre>@InterfaceAudience.Public
@InterfaceStability.Evolving
public class <span class="typeNameLabel">RollingFileSystemSink</span>
extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>
implements <a href="../../../../../org/apache/hadoop/metrics2/MetricsSink.html" title="interface in org.apache.hadoop.metrics2">MetricsSink</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</a></pre>
<div class="block"><p>This class is a metrics sink that uses
<a href="../../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs"><code>FileSystem</code></a> to write the metrics logs. Every
roll interval a new directory will be created under the path specified by the
<code>basepath</code> property. All metrics will be logged to a file in the
current interval's directory in a file named &lt;hostname&gt;.log, where
&lt;hostname&gt; is the name of the host on which the metrics logging
process is running. The base path is set by the
<code>&lt;prefix&gt;.sink.&lt;instance&gt;.basepath</code> property. The
time zone used to create the current interval's directory name is GMT. If
the <code>basepath</code> property isn't specified, it will default to
&quot;/tmp&quot;, which is the temp directory on whatever default file
system is configured for the cluster.</p>
<p>The <code>&lt;prefix&gt;.sink.&lt;instance&gt;.ignore-error</code>
property controls whether an exception is thrown when an error is encountered
writing a log file. The default value is <code>true</code>. When set to
<code>false</code>, file errors are quietly swallowed.</p>
<p>The <code>roll-interval</code> property sets the amount of time before
rolling the directory. The default value is 1 hour. The roll interval may
not be less than 1 minute. The property's value should be given as
<i>number unit</i>, where <i>number</i> is an integer value, and
<i>unit</i> is a valid unit. Valid units are <i>minute</i>, <i>hour</i>,
and <i>day</i>. The units are case insensitive and may be abbreviated or
plural. If no units are specified, hours are assumed. For example,
&quot;2&quot;, &quot;2h&quot;, &quot;2 hour&quot;, and
&quot;2 hours&quot; are all valid ways to specify two hours.</p>
<p>The <code>roll-offset-interval-millis</code> property sets the upper
bound on a random time interval (in milliseconds) that is used to delay
before the initial roll. All subsequent rolls will happen an integer
number of roll intervals after the initial roll, hence retaining the original
offset. The purpose of this property is to insert some variance in the roll
times so that large clusters using this sink on every node don't cause a
performance impact on HDFS by rolling simultaneously. The default value is
30000 (30s). When writing to HDFS, as a rule of thumb, the roll offset in
millis should be no less than the number of sink instances times 5.
<p>The primary use of this class is for logging to HDFS. As it uses
<a href="../../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs"><code>FileSystem</code></a> to access the target file system,
however, it can be used to write to the local file system, Amazon S3, or any
other supported file system. The base path for the sink will determine the
file system used. An unqualified path will write to the default file system
set by the configuration.</p>
<p>Not all file systems support the ability to append to files. In file
systems without the ability to append to files, only one writer can write to
a file at a time. To allow for concurrent writes from multiple daemons on a
single host, the <code>source</code> property is used to set unique headers
for the log files. The property should be set to the name of
the source daemon, e.g. <i>namenode</i>. The value of the
<code>source</code> property should typically be the same as the property's
prefix. If this property is not set, the source is taken to be
<i>unknown</i>.</p>
<p>Instead of appending to an existing file, by default the sink
will create a new file with a suffix of &quot;.&lt;n&gt;&quot;, where
<i>n</i> is the next lowest integer that isn't already used in a file name,
similar to the Hadoop daemon logs. NOTE: the file with the <b>highest</b>
sequence number is the <b>newest</b> file, unlike the Hadoop daemon logs.</p>
<p>For file systems that allow append, the sink supports appending to the
existing file instead. If the <code>allow-append</code> property is set to
true, the sink will instead append to the existing file on file systems that
support appends. By default, the <code>allow-append</code> property is
false.</p>
<p>Note that when writing to HDFS with <code>allow-append</code> set to true,
there is a minimum acceptable number of data nodes. If the number of data
nodes drops below that minimum, the append will succeed, but reading the
data will fail with an IOException in the DataStreamer class. The minimum
number of data nodes required for a successful append is generally 2 or
3.</p>
<p>Note also that when writing to HDFS, the file size information is not
updated until the file is closed (at the end of the interval) even though
the data is being written successfully. This is a known HDFS limitation that
exists because of the performance cost of updating the metadata. See
<a href="https://issues.apache.org/jira/browse/HDFS-5478">HDFS-5478</a>.</p>
<p>When using this sink in a secure (Kerberos) environment, two additional
properties must be set: <code>keytab-key</code> and
<code>principal-key</code>. <code>keytab-key</code> should contain the key by
which the keytab file can be found in the configuration, for example,
<code>yarn.nodemanager.keytab</code>. <code>principal-key</code> should
contain the key by which the principal can be found in the configuration,
for example, <code>yarn.nodemanager.principal</code>.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/metrics2/sink/RollingFileSystemSink.html#allowAppend">allowAppend</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected <a href="../../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/metrics2/sink/RollingFileSystemSink.html#basePath">basePath</a></span></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/metrics2/sink/RollingFileSystemSink.html#forceFlush">forceFlush</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/metrics2/sink/RollingFileSystemSink.html#hasFlushed">hasFlushed</a></span></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/metrics2/sink/RollingFileSystemSink.html#ignoreError">ignoreError</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Calendar.html?is-external=true" title="class or interface in java.util">Calendar</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/metrics2/sink/RollingFileSystemSink.html#nextFlush">nextFlush</a></span></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/metrics2/sink/RollingFileSystemSink.html#rollIntervalMillis">rollIntervalMillis</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/metrics2/sink/RollingFileSystemSink.html#rollOffsetIntervalMillis">rollOffsetIntervalMillis</a></span></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/metrics2/sink/RollingFileSystemSink.html#source">source</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected static <a href="../../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/metrics2/sink/RollingFileSystemSink.html#suppliedConf">suppliedConf</a></span></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected static <a href="../../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/metrics2/sink/RollingFileSystemSink.html#suppliedFilesystem">suppliedFilesystem</a></span></code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier</th>
<th class="colLast" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/metrics2/sink/RollingFileSystemSink.html#RollingFileSystemSink--">RollingFileSystemSink</a></span>()</code>
<div class="block">Create an empty instance.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/metrics2/sink/RollingFileSystemSink.html#RollingFileSystemSink-long-long-">RollingFileSystemSink</a></span>(long&nbsp;flushIntervalMillis,
long&nbsp;flushOffsetIntervalMillis)</code>
<div class="block">Create an instance for testing.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/metrics2/sink/RollingFileSystemSink.html#close--">close</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/metrics2/sink/RollingFileSystemSink.html#flush--">flush</a></span>()</code>
<div class="block">Flush any buffered metrics</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>protected long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/metrics2/sink/RollingFileSystemSink.html#getRollInterval--">getRollInterval</a></span>()</code>
<div class="block">Extract the roll interval from the configuration and return it in
milliseconds.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/metrics2/sink/RollingFileSystemSink.html#init-org.apache.commons.configuration2.SubsetConfiguration-">init</a></span>(org.apache.commons.configuration2.SubsetConfiguration&nbsp;metrics2Properties)</code>
<div class="block">Initialize the plugin</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/metrics2/sink/RollingFileSystemSink.html#putMetrics-org.apache.hadoop.metrics2.MetricsRecord-">putMetrics</a></span>(<a href="../../../../../org/apache/hadoop/metrics2/MetricsRecord.html" title="interface in org.apache.hadoop.metrics2">MetricsRecord</a>&nbsp;record)</code>
<div class="block">Put a metrics record in the sink</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/metrics2/sink/RollingFileSystemSink.html#setInitialFlushTime-java.util.Date-">setInitialFlushTime</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util">Date</a>&nbsp;now)</code>
<div class="block">Set the <a href="../../../../../org/apache/hadoop/metrics2/sink/RollingFileSystemSink.html#nextFlush"><code>nextFlush</code></a> variable to the initial flush time.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/hadoop/metrics2/sink/RollingFileSystemSink.html#updateFlushTime-java.util.Date-">updateFlushTime</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util">Date</a>&nbsp;now)</code>
<div class="block">Update the <a href="../../../../../org/apache/hadoop/metrics2/sink/RollingFileSystemSink.html#nextFlush"><code>nextFlush</code></a> variable to the next flush time.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="source">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>source</h4>
<pre>protected&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> source</pre>
</li>
</ul>
<a name="ignoreError">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ignoreError</h4>
<pre>protected&nbsp;boolean ignoreError</pre>
</li>
</ul>
<a name="allowAppend">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>allowAppend</h4>
<pre>protected&nbsp;boolean allowAppend</pre>
</li>
</ul>
<a name="basePath">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>basePath</h4>
<pre>protected&nbsp;<a href="../../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a> basePath</pre>
</li>
</ul>
<a name="rollIntervalMillis">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>rollIntervalMillis</h4>
<pre>protected&nbsp;long rollIntervalMillis</pre>
</li>
</ul>
<a name="rollOffsetIntervalMillis">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>rollOffsetIntervalMillis</h4>
<pre>protected&nbsp;long rollOffsetIntervalMillis</pre>
</li>
</ul>
<a name="nextFlush">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>nextFlush</h4>
<pre>protected&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Calendar.html?is-external=true" title="class or interface in java.util">Calendar</a> nextFlush</pre>
</li>
</ul>
<a name="forceFlush">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>forceFlush</h4>
<pre>protected static&nbsp;boolean forceFlush</pre>
</li>
</ul>
<a name="hasFlushed">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hasFlushed</h4>
<pre>protected static volatile&nbsp;boolean hasFlushed</pre>
</li>
</ul>
<a name="suppliedConf">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>suppliedConf</h4>
<pre>protected static&nbsp;<a href="../../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</a> suppliedConf</pre>
</li>
</ul>
<a name="suppliedFilesystem">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>suppliedFilesystem</h4>
<pre>protected static&nbsp;<a href="../../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a> suppliedFilesystem</pre>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="RollingFileSystemSink--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>RollingFileSystemSink</h4>
<pre>public&nbsp;RollingFileSystemSink()</pre>
<div class="block">Create an empty instance. Required for reflection.</div>
</li>
</ul>
<a name="RollingFileSystemSink-long-long-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>RollingFileSystemSink</h4>
<pre>protected&nbsp;RollingFileSystemSink(long&nbsp;flushIntervalMillis,
long&nbsp;flushOffsetIntervalMillis)</pre>
<div class="block">Create an instance for testing.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>flushIntervalMillis</code> - the roll interval in millis</dd>
<dd><code>flushOffsetIntervalMillis</code> - the roll offset interval in millis</dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="init-org.apache.commons.configuration2.SubsetConfiguration-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>init</h4>
<pre>public&nbsp;void&nbsp;init(org.apache.commons.configuration2.SubsetConfiguration&nbsp;metrics2Properties)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../org/apache/hadoop/metrics2/MetricsPlugin.html#init-org.apache.commons.configuration2.SubsetConfiguration-">MetricsPlugin</a></code></span></div>
<div class="block">Initialize the plugin</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/hadoop/metrics2/MetricsPlugin.html#init-org.apache.commons.configuration2.SubsetConfiguration-">init</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/hadoop/metrics2/MetricsPlugin.html" title="interface in org.apache.hadoop.metrics2">MetricsPlugin</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>metrics2Properties</code> - the configuration object for the plugin</dd>
</dl>
</li>
</ul>
<a name="getRollInterval--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRollInterval</h4>
<pre>protected&nbsp;long&nbsp;getRollInterval()</pre>
<div class="block">Extract the roll interval from the configuration and return it in
milliseconds.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the roll interval in millis</dd>
</dl>
</li>
</ul>
<a name="updateFlushTime-java.util.Date-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>updateFlushTime</h4>
<pre>protected&nbsp;void&nbsp;updateFlushTime(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util">Date</a>&nbsp;now)</pre>
<div class="block">Update the <a href="../../../../../org/apache/hadoop/metrics2/sink/RollingFileSystemSink.html#nextFlush"><code>nextFlush</code></a> variable to the next flush time. Add
an integer number of flush intervals, preserving the initial random offset.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>now</code> - the current time</dd>
</dl>
</li>
</ul>
<a name="setInitialFlushTime-java.util.Date-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setInitialFlushTime</h4>
<pre>protected&nbsp;void&nbsp;setInitialFlushTime(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util">Date</a>&nbsp;now)</pre>
<div class="block">Set the <a href="../../../../../org/apache/hadoop/metrics2/sink/RollingFileSystemSink.html#nextFlush"><code>nextFlush</code></a> variable to the initial flush time. The initial
flush will be an integer number of flush intervals past the beginning of
the current hour and will have a random offset added, up to
<a href="../../../../../org/apache/hadoop/metrics2/sink/RollingFileSystemSink.html#rollOffsetIntervalMillis"><code>rollOffsetIntervalMillis</code></a>. The initial flush will be a time in
past that can be used from which to calculate future flush times.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>now</code> - the current time</dd>
</dl>
</li>
</ul>
<a name="putMetrics-org.apache.hadoop.metrics2.MetricsRecord-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>putMetrics</h4>
<pre>public&nbsp;void&nbsp;putMetrics(<a href="../../../../../org/apache/hadoop/metrics2/MetricsRecord.html" title="interface in org.apache.hadoop.metrics2">MetricsRecord</a>&nbsp;record)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../org/apache/hadoop/metrics2/MetricsSink.html#putMetrics-org.apache.hadoop.metrics2.MetricsRecord-">MetricsSink</a></code></span></div>
<div class="block">Put a metrics record in the sink</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/hadoop/metrics2/MetricsSink.html#putMetrics-org.apache.hadoop.metrics2.MetricsRecord-">putMetrics</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/hadoop/metrics2/MetricsSink.html" title="interface in org.apache.hadoop.metrics2">MetricsSink</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>record</code> - the record to put</dd>
</dl>
</li>
</ul>
<a name="flush--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>flush</h4>
<pre>public&nbsp;void&nbsp;flush()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../org/apache/hadoop/metrics2/MetricsSink.html#flush--">MetricsSink</a></code></span></div>
<div class="block">Flush any buffered metrics</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/hadoop/metrics2/MetricsSink.html#flush--">flush</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/hadoop/metrics2/MetricsSink.html" title="interface in org.apache.hadoop.metrics2">MetricsSink</a></code></dd>
</dl>
</li>
</ul>
<a name="close--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>close</h4>
<pre>public&nbsp;void&nbsp;close()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/Closeable.html?is-external=true#close--" title="class or interface in java.io">close</a></code>&nbsp;in interface&nbsp;<code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</a></code></dd>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html?is-external=true#close--" title="class or interface in java.lang">close</a></code>&nbsp;in interface&nbsp;<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html?is-external=true" title="class or interface in java.lang">AutoCloseable</a></code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/RollingFileSystemSink.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/hadoop/metrics2/sink/KafkaSink.html" title="class in org.apache.hadoop.metrics2.sink"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/hadoop/metrics2/sink/StatsDSink.html" title="class in org.apache.hadoop.metrics2.sink"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/hadoop/metrics2/sink/RollingFileSystemSink.html" target="_top">Frames</a></li>
<li><a href="RollingFileSystemSink.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2021 <a href="https://www.apache.org">Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>