Codota Logo
CounterTimeseriesTable
Code IndexAdd Codota to your IDE (free)

How to use
CounterTimeseriesTable
in
co.cask.cdap.api.dataset.lib

Best Java code snippets using co.cask.cdap.api.dataset.lib.CounterTimeseriesTable (Showing top 6 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
FileOutputStream f =
  • Codota IconFile file;new FileOutputStream(file)
  • Codota IconString name;new FileOutputStream(name)
  • Codota IconFile file;new FileOutputStream(file, true)
  • Smart code suggestions by Codota
}
origin: cdapio/cdap

 @Override
 public CounterTimeseriesTable getDataset(DatasetContext datasetContext, DatasetSpecification spec,
                      Map<String, String> arguments, ClassLoader classLoader) throws IOException {
  return new CounterTimeseriesTable(spec, this.<Table>getDataset(datasetContext, "ts", spec, arguments, classLoader));
 }
}
origin: cdapio/cdap

/**
 * Increments the value for a counter for a row and timestamp.
 *
 * @param counter the name of the counter to increment
 * @param amount the amount to increment by
 * @param timestamp timestamp of the entry
 * @param tags optional list of tags associated with the counter. See {@link TimeseriesTable} class description
 *             for more details.
 * @return value of the entry after increment
 */
@ReadWrite
public long increment(byte[] counter, long amount, long timestamp, byte[]... tags) {
 return internalIncrement(counter, amount, timestamp, tags);
}
origin: cdapio/cdap

final Iterator<Entry> internalItor = readInternal(counter, startTime, endTime, tags);
return new Iterator<Counter>() {
 @Override
origin: caskdata/cdap

assertEquals(2L, table.increment(rowKey1, 2L, timestamp1));
assertEquals(2L, table.increment(rowKey1, 0L, timestamp1));
assertEquals(7L, table.increment(rowKey1, 5L, timestamp1));
assertEquals(-2L, table.increment(rowKey2, -2L, timestamp1));
assertEquals(0L, table.increment(rowKey3, 0L, timestamp1));
assertEquals(5L, table.increment(rowKey1, 5L, timestamp2));
assertEquals(10L, table.increment(rowKey1, 5L, timestamp2));
assertEquals(7L, table.increment(rowKey1, 7L, timestamp3));
assertEquals(-2L, table.increment(rowKey2, 0L, timestamp1));
table.set(rowKey1, 20L, timestamp4);
Iterator<CounterTimeseriesTable.Counter> result = table.read(rowKey1, timestamp4, timestamp4);
assertCounterEquals(rowKey1, 20L, timestamp4, result.next());
assertFalse(result.hasNext());
result = table.read(rowKey1, timestamp1, timestamp4);
assertCounterEquals(rowKey1, 7L, timestamp1, result.next());
assertCounterEquals(rowKey1, 10L, timestamp2, result.next());
result = table.read(rowKey1, timestamp1, timestamp3, 1, 2);
assertCounterEquals(rowKey1, 10L, timestamp2, result.next());
assertCounterEquals(rowKey1, 7L, timestamp3, result.next());
assertFalse(result.hasNext());
table.set(rowKey4, 3L, timestamp1, tag1);
table.increment(rowKey4, 5L, timestamp2);
table.increment(rowKey4, 7L, timestamp3);
table.increment(rowKey4, 11L, timestamp3, tag1);
table.increment(rowKey4, 13L, timestamp3);
origin: cdapio/cdap

final Iterator<Counter> iterator = read(counter, startTime, endTime, tags);
origin: cdapio/cdap

/**
 * Set the value for a counter.
 *
 * @param counter the name of the counter to set
 * @param value the value to set
 * @param timestamp timestamp of the entry
 * @param tags optional list of tags associated with the counter. See {@link TimeseriesTable} class description
 *             for more details.
 */
@WriteOnly
public void set(byte[] counter, long value, long timestamp, byte[]... tags) {
 write(counter, Bytes.toBytes(value), timestamp, tags);
}
co.cask.cdap.api.dataset.libCounterTimeseriesTable

Javadoc

A Dataset for incrementing counts over time periods. This Dataset provides an extension to TimeseriesTablefor long values and provides increment methods for counting.

For more information on choosing values for rowPartitionIntervalSize and tag usage, please see the TimeseriesTable class description.

Most used methods

  • read
    Reads entries for a given time range and returns an Iterator. NOTE: A limit is placed on the max num
  • <init>
    Creates an instance of the DataSet.
  • increment
    Increments the value for a counter for a row and timestamp.
  • internalIncrement
  • readInternal
  • set
    Set the value for a counter.
  • write

Popular in Java

  • Updating database using SQL prepared statement
  • requestLocationUpdates (LocationManager)
  • addToBackStack (FragmentTransaction)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • PriorityQueue (java.util)
    An unbounded priority Queue based on a priority heap. The elements of the priority queue are ordered
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now