Tabnine Logo
CuratorService.zkUpdate
Code IndexAdd Tabnine to your IDE (free)

How to use
zkUpdate
method
in
org.apache.hadoop.registry.client.impl.zk.CuratorService

Best Java code snippets using org.apache.hadoop.registry.client.impl.zk.CuratorService.zkUpdate (Showing top 10 results out of 315)

origin: io.hops/hadoop-yarn-registry

/**
 * Create or update an entry
 * @param path path
 * @param data data
 * @param acl ACL for path -used when creating a new entry
 * @param overwrite enable overwrite
 * @throws IOException
 * @return true if the entry was created, false if it was simply updated.
 */
public boolean zkSet(String path,
  CreateMode mode,
  byte[] data,
  List<ACL> acl, boolean overwrite) throws IOException {
 Preconditions.checkArgument(data != null, "null data");
 checkServiceLive();
 if (!zkPathExists(path)) {
  zkCreate(path, mode, data, acl);
  return true;
 } else {
  if (overwrite) {
   zkUpdate(path, data);
   return false;
  } else {
   throw new FileAlreadyExistsException(path);
  }
 }
}
origin: org.apache.hadoop/hadoop-yarn-registry

/**
 * Create or update an entry.
 *
 * @param path      path
 * @param data      data
 * @param acl       ACL for path -used when creating a new entry
 * @param overwrite enable overwrite
 * @return true if the entry was created, false if it was simply updated.
 * @throws IOException
 */
public boolean zkSet(String path,
  CreateMode mode,
  byte[] data,
  List<ACL> acl, boolean overwrite) throws IOException {
 Preconditions.checkArgument(data != null, "null data");
 checkServiceLive();
 if (!zkPathExists(path)) {
  zkCreate(path, mode, data, acl);
  return true;
 } else {
  if (overwrite) {
   zkUpdate(path, data);
   return false;
  } else {
   throw new FileAlreadyExistsException(path);
  }
 }
}
origin: io.hops/hadoop-yarn-registry

@Test(expected = PathNotFoundException.class)
public void testUpdateMissing() throws Throwable {
 curatorService.zkUpdate("/testupdatemissing", getTestBuffer());
}
origin: org.apache.hadoop/hadoop-yarn-registry

@Test(expected = PathNotFoundException.class)
public void testUpdateMissing() throws Throwable {
 curatorService.zkUpdate("/testupdatemissing", getTestBuffer());
}
origin: io.hops/hadoop-yarn-registry

@Test
public void testCreateUpdate() throws Throwable {
 byte[] buffer = getTestBuffer();
 curatorService.zkCreate("/testcreateupdate",
   CreateMode.PERSISTENT, buffer,
   rootACL
 );
 curatorService.zkUpdate("/testcreateupdate", buffer);
}
origin: org.apache.hadoop/hadoop-yarn-registry

@Test
public void testUpdateDirectory() throws Throwable {
 mkPath("/testupdatedirectory", CreateMode.PERSISTENT);
 curatorService.zkUpdate("/testupdatedirectory", getTestBuffer());
}
origin: org.apache.hadoop/hadoop-yarn-registry

@Test
public void testCreateUpdate() throws Throwable {
 byte[] buffer = getTestBuffer();
 curatorService.zkCreate("/testcreateupdate",
   CreateMode.PERSISTENT, buffer,
   rootACL
 );
 curatorService.zkUpdate("/testcreateupdate", buffer);
}
origin: io.hops/hadoop-yarn-registry

@Test
public void testUpdateDirectory() throws Throwable {
 mkPath("/testupdatedirectory", CreateMode.PERSISTENT);
 curatorService.zkUpdate("/testupdatedirectory", getTestBuffer());
}
origin: io.hops/hadoop-yarn-registry

@Test
public void testUpdateDirectorywithChild() throws Throwable {
 mkPath("/testupdatedirectorywithchild", CreateMode.PERSISTENT);
 mkPath("/testupdatedirectorywithchild/child", CreateMode.PERSISTENT);
 curatorService.zkUpdate("/testupdatedirectorywithchild", getTestBuffer());
}
origin: org.apache.hadoop/hadoop-yarn-registry

@Test
public void testUpdateDirectorywithChild() throws Throwable {
 mkPath("/testupdatedirectorywithchild", CreateMode.PERSISTENT);
 mkPath("/testupdatedirectorywithchild/child", CreateMode.PERSISTENT);
 curatorService.zkUpdate("/testupdatedirectorywithchild", getTestBuffer());
}
org.apache.hadoop.registry.client.impl.zkCuratorServicezkUpdate

Javadoc

Update the data for a path

Popular methods of CuratorService

  • zkPathExists
    Probe for a path existing
  • bindingDiagnosticDetails
    Get the binding diagnostics
  • dumpPath
    Return a path dumper instance which can do a full dump of the registry tree in its toString() operat
  • zkCreate
    Create a path with given data. byte[0] is used for a path without data
  • zkMkPath
    Create a directory. It is not an error if it already exists
  • <init>
    Construct the service.
  • addService
  • buildConnectionString
    Override point: get the connection string used to connect to the ZK service
  • buildSecurityDiagnostics
    Build the security diagnostics string
  • checkServiceLive
    Internal check that a service is in the live state
  • createCurator
    Create a new curator instance off the root path; using configuration options provided in the service
  • createEnsembleProvider
    Create the ensemble provider for this registry, by invoking RegistryBindingSource#supplyBindingInfor
  • createCurator,
  • createEnsembleProvider,
  • createFullPath,
  • getConfig,
  • getName,
  • getRegistrySecurity,
  • getServiceState,
  • init,
  • isInState

Popular in Java

  • Updating database using SQL prepared statement
  • compareTo (BigDecimal)
  • setContentView (Activity)
  • putExtra (Intent)
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • JList (javax.swing)
  • JPanel (javax.swing)
  • 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