DateTimeBucketer instead.@Deprecated public class DateTimeBucketer extends Object implements Bucketer
Bucketer that assigns to buckets based on current system time.
The DateTimeBucketer will create directories of the following form:
/{basePath}/{dateTimePath}/. The basePath is the path
that was specified as a base path when creating the
RollingSink. The dateTimePath
is determined based on the current system time and the user provided format string.
SimpleDateFormat is used to derive a date string from the current system time and
the date format string. The default format string is "yyyy-MM-dd--HH" so the rolling
files will have a granularity of hours.
Example:
Bucketer buck = new DateTimeBucketer("yyyy-MM-dd--HH");
This will create for example the following bucket path:
/base/1976-12-31--14/
| 构造器和说明 |
|---|
DateTimeBucketer()
已过时。
Creates a new
DateTimeBucketer with format string "yyyy-MM-dd--HH". |
DateTimeBucketer(String formatString)
已过时。
Creates a new
DateTimeBucketer with the given date/time format string. |
| 限定符和类型 | 方法和说明 |
|---|---|
org.apache.hadoop.fs.Path |
getNextBucketPath(org.apache.hadoop.fs.Path basePath)
已过时。
Returns the
Path of a new bucket file. |
static void |
setClock(Clock newClock)
已过时。
This sets the internal
Clock implementation. |
boolean |
shouldStartNewBucket(org.apache.hadoop.fs.Path basePath,
org.apache.hadoop.fs.Path currentBucketPath)
已过时。
Returns
true when a new bucket should be started. |
String |
toString()
已过时。
|
public DateTimeBucketer()
DateTimeBucketer with format string "yyyy-MM-dd--HH".public DateTimeBucketer(String formatString)
DateTimeBucketer with the given date/time format string.formatString - The format string that will be given to SimpleDateFormat to determine
the bucket path.public boolean shouldStartNewBucket(org.apache.hadoop.fs.Path basePath,
org.apache.hadoop.fs.Path currentBucketPath)
Bucketertrue when a new bucket should be started.shouldStartNewBucket 在接口中 BucketercurrentBucketPath - The bucket Path that is currently being used.public org.apache.hadoop.fs.Path getNextBucketPath(org.apache.hadoop.fs.Path basePath)
BucketerPath of a new bucket file.getNextBucketPath 在接口中 BucketerbasePath - The base path containing all the buckets.Path of the new bucket. This should include the basePath
and also the subtaskIndex tp avoid clashes with parallel sinks.Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.