@InterfaceAudience.Public @InterfaceStability.Unstable public class KuduScanToken extends Object implements Comparable<KuduScanToken>
KuduScanToken.KuduScanTokenBuilder
, clients can
describe the desired scan, including predicates, bounds, timestamps, and
caching, and receive back a collection of scan tokens.
Each scan token may be separately turned into a scanner using
intoScanner(org.apache.kudu.client.KuduClient)
, with each scanner responsible for a disjoint section
of the table.
Scan tokens may be serialized using the serialize()
method and
deserialized back into a scanner using the deserializeIntoScanner(byte[], org.apache.kudu.client.KuduClient)
method. This allows use cases such as generating scan tokens in the planner
component of a query engine, then sending the tokens to execution nodes based
on locality, and then instantiating the scanners on those nodes.
Scan token locality information can be inspected using the getTablet()
method.Modifier and Type | Class and Description |
---|---|
static class |
KuduScanToken.KuduScanTokenBuilder
Builds a sequence of scan tokens.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(KuduScanToken other) |
static KuduScanner |
deserializeIntoScanner(byte[] buf,
KuduClient client)
Deserializes a
KuduScanToken into a KuduScanner . |
static KuduScanner.KuduScannerBuilder |
deserializeIntoScannerBuilder(byte[] buf,
KuduClient client)
Deserializes a
KuduScanToken into a KuduScanner.KuduScannerBuilder . |
boolean |
equals(Object o) |
LocatedTablet |
getTablet()
Returns the tablet which the scanner created from this token will access.
|
int |
hashCode() |
KuduScanner |
intoScanner(KuduClient client)
Creates a
KuduScanner from this scan token. |
byte[] |
serialize()
Serializes this
KuduScanToken into a byte array. |
static String |
stringifySerializedToken(byte[] buf,
KuduClient client)
Formats the serialized token for debug printing.
|
public LocatedTablet getTablet()
public KuduScanner intoScanner(KuduClient client) throws IOException
KuduScanner
from this scan token.client
- a Kudu client for the clusterIOException
public byte[] serialize() throws IOException
KuduScanToken
into a byte array.IOException
public static KuduScanner deserializeIntoScanner(byte[] buf, KuduClient client) throws IOException
KuduScanToken
into a KuduScanner
.buf
- a byte array containing the serialized scan token.client
- a Kudu client for the clusterIOException
public static KuduScanner.KuduScannerBuilder deserializeIntoScannerBuilder(byte[] buf, KuduClient client) throws IOException
KuduScanToken
into a KuduScanner.KuduScannerBuilder
.buf
- a byte array containing the serialized scan token.client
- a Kudu client for the clusterIOException
public static String stringifySerializedToken(byte[] buf, KuduClient client) throws IOException
buf
- the serialized tokenclient
- a Kudu client for the cluster to which the token belongsIOException
public int compareTo(KuduScanToken other)
compareTo
in interface Comparable<KuduScanToken>