Tabnine Logo
CounterTimeseriesTable
Code IndexAdd Tabnine 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)

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

  • Reading from database using SQL prepared statement
  • setContentView (Activity)
  • getResourceAsStream (ClassLoader)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now