public static class Offsets.PartitionOffset.Builder extends Object
Offsets.PartitionOffset
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
Offsets.PartitionOffset |
build()
Builds a PartitionOffset instance.
|
static Offsets.PartitionOffset.Builder |
newBuilder()
Creates a new builder instance.
|
Offsets.PartitionOffset.Builder |
setOffset(long offset)
Set the
offset for the partition offset being built. |
Offsets.PartitionOffset.Builder |
setPartition(int partition)
Set the
partition for the partition offset being built |
Offsets.PartitionOffset.Builder |
setTopic(String topic)
Set the
topic for the partition offset being built |
public static Offsets.PartitionOffset.Builder newBuilder()
public Offsets.PartitionOffset.Builder setTopic(String topic)
topic
for the partition offset being builttopic
- the topic for the partition offset being built.IllegalArgumentException
- if the topic
is null
or empty.public Offsets.PartitionOffset.Builder setPartition(int partition)
partition
for the partition offset being builtpartition
- the partition for the partition offset being built.IllegalArgumentException
- if the partition
is less than 0.public Offsets.PartitionOffset.Builder setOffset(long offset)
offset
for the partition offset being built. If the offset
is not
set then it defaults to OffsetRequest.EarliestTime()
.offset
- the topic for the partition offset being built.public Offsets.PartitionOffset build()
IllegalStateException
- if the topic
or partition
are never set or configured
to invalid values.Copyright © 2017 The Apache Software Foundation. All rights reserved.