Search in sources :

Example 11 with KeyValue

use of co.cask.cdap.api.dataset.lib.KeyValue in project cdap by caskdata.

the class AuthorizationTest method assertDatasetIsEmpty.

private void assertDatasetIsEmpty(NamespaceId namespaceId, String datasetName) throws Exception {
    DataSetManager<KeyValueTable> outTableManager = getDataset(namespaceId.dataset(datasetName));
    KeyValueTable outputTable = outTableManager.get();
    try (CloseableIterator<KeyValue<byte[], byte[]>> scanner = outputTable.scan(null, null)) {
        Assert.assertFalse(scanner.hasNext());
    }
}
Also used : KeyValue(co.cask.cdap.api.dataset.lib.KeyValue) KeyValueTable(co.cask.cdap.api.dataset.lib.KeyValueTable)

Aggregations

KeyValue (co.cask.cdap.api.dataset.lib.KeyValue)11 KeyValueTable (co.cask.cdap.api.dataset.lib.KeyValueTable)8 ApplicationManager (co.cask.cdap.test.ApplicationManager)5 Test (org.junit.Test)4 CloseableIterator (co.cask.cdap.api.dataset.lib.CloseableIterator)3 SparkManager (co.cask.cdap.test.SparkManager)3 IOException (java.io.IOException)3 FileSet (co.cask.cdap.api.dataset.lib.FileSet)2 URI (java.net.URI)2 HashMap (java.util.HashMap)2 Location (org.apache.twill.filesystem.Location)2 TxRunnable (co.cask.cdap.api.TxRunnable)1 DatasetContext (co.cask.cdap.api.data.DatasetContext)1 StructuredRecord (co.cask.cdap.api.data.format.StructuredRecord)1 ObjectMappedTable (co.cask.cdap.api.dataset.lib.ObjectMappedTable)1 PartitionDetail (co.cask.cdap.api.dataset.lib.PartitionDetail)1 PartitionedFileSet (co.cask.cdap.api.dataset.lib.PartitionedFileSet)1 Scan (co.cask.cdap.api.dataset.table.Scan)1 RuntimeMetrics (co.cask.cdap.api.metrics.RuntimeMetrics)1 PipelinePhase (co.cask.cdap.etl.common.PipelinePhase)1