public class InMemoryMetricsTable extends Object implements MetricsTable
| Constructor and Description |
|---|
InMemoryMetricsTable(co.cask.cdap.api.dataset.DatasetContext datasetContext,
String name,
CConfiguration cConf)
To be used in tests that need namespaces
|
InMemoryMetricsTable(String name)
To be used in tests that do not need namespaces
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
delete(byte[] row,
byte[][] columns)
Deletes specified columns of the specified row.
|
byte[] |
get(byte[] row,
byte[] column)
Read single column of a row
|
void |
increment(byte[] row,
Map<byte[],Long> increments)
Atomic increment of multiple columns of a row.
|
void |
increment(NavigableMap<byte[],NavigableMap<byte[],Long>> updates)
Batch increment multiple rows each with multiple columns and increments
|
long |
incrementAndGet(byte[] row,
byte[] column,
long delta)
Increment a single column of a row and return the new value.
|
void |
put(SortedMap<byte[],? extends SortedMap<byte[],Long>> updates)
Write multiple rows, each with multiple individual columns to write.
|
co.cask.cdap.api.dataset.table.Scanner |
scan(byte[] start,
byte[] stop,
FuzzyRowFilter filter)
Get a scanner for a table.
|
boolean |
swap(byte[] row,
byte[] column,
byte[] oldValue,
byte[] newValue)
Atomically compare a single column of a row with a expected value, and if it matches, replace it with a new value.
|
public InMemoryMetricsTable(co.cask.cdap.api.dataset.DatasetContext datasetContext,
String name,
CConfiguration cConf)
public InMemoryMetricsTable(String name)
public byte[] get(byte[] row,
byte[] column)
MetricsTableget in interface MetricsTablepublic void put(SortedMap<byte[],? extends SortedMap<byte[],Long>> updates)
MetricsTableput in interface MetricsTablepublic boolean swap(byte[] row,
byte[] column,
byte[] oldValue,
byte[] newValue)
MetricsTableswap in interface MetricsTableoldValue - the expected value of the column. If null, this means that the column must not exist.newValue - the new value of the column. If null, the effect to delete the column if the comparison succeeds.public void increment(byte[] row,
Map<byte[],Long> increments)
MetricsTableincrement in interface MetricsTableincrements - Map from each column key to the value it should be incremented by.public void increment(NavigableMap<byte[],NavigableMap<byte[],Long>> updates)
MetricsTableincrement in interface MetricsTablepublic long incrementAndGet(byte[] row,
byte[] column,
long delta)
MetricsTableincrementAndGet in interface MetricsTablepublic void delete(byte[] row,
byte[][] columns)
MetricsTabledelete in interface MetricsTablerow - row to delete fromcolumns - names of columns to deletepublic co.cask.cdap.api.dataset.table.Scanner scan(@Nullable byte[] start, @Nullable byte[] stop, @Nullable FuzzyRowFilter filter)
MetricsTablescan in interface MetricsTablestart - the row key of the first row to scan. If null, the scan begins at the first row of the table.stop - the row key of the last row to scan. If null, the scan goes to the last row of the table.filter - if non-null, a fuzzy row filter used to efficiently skip over entire rows.public void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.