public class MetadataStoreDataset
extends co.cask.cdap.api.dataset.lib.AbstractDataset
| Modifier and Type | Class and Description |
|---|---|
class |
MetadataStoreDataset.KeyValue<T>
Output value of a scan.
|
| Constructor and Description |
|---|
MetadataStoreDataset(co.cask.cdap.api.dataset.table.Table table) |
| Modifier and Type | Method and Description |
|---|---|
void |
deleteAll(MDSKey id) |
protected <T> T |
deserialize(byte[] serialized,
Type typeOfT) |
boolean |
exists(MDSKey id) |
<T> T |
get(MDSKey id,
Type typeOfT) |
<T> T |
getFirst(MDSKey id,
Type typeOfT) |
<T> List<T> |
list(MDSKey startId,
MDSKey stopId,
Type typeOfT,
int limit,
com.google.common.base.Predicate<T> filter) |
<T> List<T> |
list(MDSKey id,
Type typeOfT) |
<T> List<T> |
list(MDSKey id,
Type typeOfT,
int limit) |
<T> Map<MDSKey,T> |
listKV(MDSKey startId,
MDSKey stopId,
Type typeOfT,
int limit,
com.google.common.base.Predicate<T> filter) |
<T> Map<MDSKey,T> |
listKV(MDSKey id,
Type typeOfT) |
<T> Map<MDSKey,T> |
listKV(MDSKey id,
Type typeOfT,
int limit) |
<T> void |
scan(MDSKey startId,
MDSKey stopId,
Type typeOfT,
com.google.common.base.Function<MetadataStoreDataset.KeyValue<T>,Boolean> function)
Run a scan on MDS.
|
protected <T> byte[] |
serialize(T value) |
<T> void |
write(MDSKey id,
T value) |
public MetadataStoreDataset(co.cask.cdap.api.dataset.table.Table table)
protected <T> byte[] serialize(T value)
protected <T> T deserialize(byte[] serialized,
Type typeOfT)
public boolean exists(MDSKey id)
public <T> List<T> list(MDSKey startId, @Nullable MDSKey stopId, Type typeOfT, int limit, com.google.common.base.Predicate<T> filter)
public <T> Map<MDSKey,T> listKV(MDSKey startId, @Nullable MDSKey stopId, Type typeOfT, int limit, com.google.common.base.Predicate<T> filter)
public <T> void scan(MDSKey startId, @Nullable MDSKey stopId, Type typeOfT, com.google.common.base.Function<MetadataStoreDataset.KeyValue<T>,Boolean> function)
T - type of valuestartId - scan start keystopId - scan stop keytypeOfT - type of valuefunction - function to process each element returned from scan.
If function.apply returns false then the scan is stopped.
Also, function.apply should not return null.public void deleteAll(MDSKey id)
public <T> void write(MDSKey id, T value)
Copyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.