Tabnine Logo
PartitionedFileSet.addPartition
Code IndexAdd Tabnine to your IDE (free)

How to use
addPartition
method
in
co.cask.cdap.api.dataset.lib.PartitionedFileSet

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

origin: cdapio/cdap

 @Override
 public void run() {
  pfs.addPartition(KEY_4, path3);
 }
});
origin: cdapio/cdap

 @Override
 public void run() {
  pfs.addPartition(KEY_1, path3);
 }
});
origin: cdapio/cdap

 @Override
 public void run() {
  pfs.addPartition(KEY_3, path3);
  throw new RuntimeException("fail the tx");
 }
});
origin: caskdata/cdap

 @Override
 public void apply() throws Exception {
  Assert.assertTrue(pfsBaseLocation.exists());
  // attempt to write a new partition - should fail
  try {
   pfs.getPartitionOutput(PARTITION_KEY);
   Assert.fail("External partitioned file set should not allow writing files");
  } catch (UnsupportedOperationException e) {
   // expected
  }
  // create an external file and add it as a partition
  File someFile = new File(absolutePath, "some.file");
  OutputStream out = new FileOutputStream(someFile);
  out.close();
  Assert.assertTrue(someFile.exists());
  pfs.addPartition(PARTITION_KEY, "some.file");
  Assert.assertNotNull(pfs.getPartition(PARTITION_KEY));
  Assert.assertTrue(pfs.getPartition(PARTITION_KEY).getLocation().exists());
  // now drop the partition and validate the file is still there
  pfs.dropPartition(PARTITION_KEY);
  Assert.assertNull(pfs.getPartition(PARTITION_KEY));
  Assert.assertTrue(someFile.exists());
 }
});
origin: cdapio/cdap

 writer.write("2,2\n");
pfs.addPartition(KEY_2, path2);
origin: cdapio/cdap

 writer.write("1,x\n");
pfs.get().addPartition(PartitionKey.builder().addStringField("x", "1").build(), "some/path");
pfs.flush();
origin: caskdata/cdap

 pfs.addPartition(
  PartitionKey.builder().addField("i", 1).addField("l", "2").addField("s", "a").build(),
  "some/location");
 pfs.addPartition(
  PartitionKey.builder().addField("i", 1).addField("l", 2L).addField("s", "a").addField("x", "x").build(),
  "some/location", ImmutableMap.of("a", "b"));
pfs.addPartition(
 PartitionKey.builder().addField("i", 1).addField("l", 2L).addField("s", "a").build(),
 "some/location", ImmutableMap.of("a", "b"));
co.cask.cdap.api.dataset.libPartitionedFileSetaddPartition

Javadoc

Add a partition for a given partition key, stored at a given path (relative to the file set's base path).

Popular methods of PartitionedFileSet

  • getPartition
  • getEmbeddedFileSet
  • dropPartition
  • getPartitionOutput
    Return a partition output for a specific partition key, in preparation for creating a new partition.
  • getPartitions
  • consumePartitions
  • getPartitioning
  • addMetadata
    Adds a set of new metadata entries for a particular partition. Note that existing entries cannot be
  • concatenatePartition
    Asynchronous operation to concatenate the partition in Hive. Note that Hive only supports certain fo
  • removeMetadata
    Removes a set of metadata entries for a particular partition. If any metadata key does not exist, no
  • setMetadata
    Sets metadata entries for a particular partition. If the metadata entry key does not already exist,
  • setMetadata

Popular in Java

  • Parsing JSON documents to java classes using gson
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getApplicationContext (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • CodeWhisperer alternatives
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