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

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

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

origin: io.hops/hadoop-yarn-registry

 public void verifyNotExists(String path) throws IOException {
  if (curatorService.zkPathExists(path)) {
   fail("Path should not exist: " + path);
  }
 }
}
origin: org.apache.hadoop/hadoop-yarn-registry

 public void verifyNotExists(String path) throws IOException {
  if (curatorService.zkPathExists(path)) {
   fail("Path should not exist: " + 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

/**
 * 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

@Test
public void testExistsMissing() throws Throwable {
 assertFalse(curatorService.zkPathExists(MISSING));
}
origin: org.apache.hadoop/hadoop-yarn-registry

@Test
public void testExists() throws Throwable {
 assertTrue(curatorService.zkPathExists("/"));
}
origin: io.hops/hadoop-yarn-registry

@Test
public void testExists() throws Throwable {
 assertTrue(curatorService.zkPathExists("/"));
}
origin: io.hops/hadoop-yarn-registry

@Test
public void testExistsMissing() throws Throwable {
 assertFalse(curatorService.zkPathExists(MISSING));
}
origin: org.apache.hadoop/hadoop-yarn-services-api

  .currentUser(), YarnServiceConstants.APP_TYPE, exampleApp.getName());
Assert.assertTrue("Registry ZK service path doesn't exist",
  getCuratorService().zkPathExists(serviceZKPath));
  getCuratorService().zkPathExists(serviceZKPath));
org.apache.hadoop.registry.client.impl.zkCuratorServicezkPathExists

Javadoc

Probe for a path existing

Popular methods of CuratorService

  • 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
  • zkUpdate
    Update the data for a path
  • <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

  • Creating JSON documents from java classes using gson
  • onCreateOptionsMenu (Activity)
  • putExtra (Intent)
  • onRequestPermissionsResult (Fragment)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Top 12 Jupyter Notebook extensions
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