congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
KeeperException$BadArgumentsException.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.apache.zookeeper.KeeperException$BadArgumentsException
constructor

Best Java code snippets using org.apache.zookeeper.KeeperException$BadArgumentsException.<init> (Showing top 19 results out of 315)

origin: apache/zookeeper

/**
 * Performs basic validation of a path for a create request.
 * Throws if the path is not valid and returns the parent path.
 * @throws BadArgumentsException
 */
private String validatePathForCreate(String path, long sessionId)
    throws BadArgumentsException {
  int lastSlash = path.lastIndexOf('/');
  if (lastSlash == -1 || path.indexOf('\0') != -1 || failCreate) {
    LOG.info("Invalid path %s with session 0x%s",
        path, Long.toHexString(sessionId));
    throw new KeeperException.BadArgumentsException(path);
  }
  return path.substring(0, lastSlash);
}
origin: apache/zookeeper

public void checkAddressDuplicate(QuorumServer s) throws BadArgumentsException {
  List<InetSocketAddress> otherAddrs = new ArrayList<InetSocketAddress>();
  otherAddrs.add(s.addr);
  otherAddrs.add(s.clientAddr);
  otherAddrs.add(s.electionAddr);
  otherAddrs = excludedSpecialAddresses(otherAddrs);
  for (InetSocketAddress my: this.myAddrs) {
    for (InetSocketAddress other: otherAddrs) {
      if (my.equals(other)) {
        String error = String.format("%s of server.%d conflicts %s of server.%d", my, this.id, other, s.id);
        throw new BadArgumentsException(error);
      }
    }
  }
}
origin: apache/zookeeper

private void validatePath(String path, long sessionId) throws BadArgumentsException {
  try {
    PathUtils.validatePath(path);
  } catch(IllegalArgumentException ie) {
    LOG.info("Invalid path {} with session 0x{}, reason: {}",
        path, Long.toHexString(sessionId), ie.getMessage());
    throw new BadArgumentsException(path);
  }
}
origin: org.apache.hadoop/zookeeper

String path = existsRequest.getPath();
if (path.indexOf('\0') != -1) {
  throw new KeeperException.BadArgumentsException();
origin: org.apache.hadoop/zookeeper

  LOG.info("Invalid path " + path + " with session 0x" +
      Long.toHexString(request.sessionId));
  throw new KeeperException.BadArgumentsException(path);
  LOG.info("Invalid path " + path + " with session 0x" +
      Long.toHexString(request.sessionId));
  throw new KeeperException.BadArgumentsException(path);
if (lastSlash == -1 || path.indexOf('\0') != -1
    || zks.getZKDatabase().isSpecialPath(path)) {
  throw new KeeperException.BadArgumentsException(path);
origin: org.apache.hadoop/zookeeper

  return new OperationTimeoutException();
case BADARGUMENTS:
  return new BadArgumentsException();
case APIERROR:
  return new APIErrorException();
origin: org.apache.hadoop/zookeeper

  /**
   * Map an integer value to a CreateMode value
   */
  static public CreateMode fromFlag(int flag) throws KeeperException {
    switch(flag) {
    case 0: return CreateMode.PERSISTENT;

    case 1: return CreateMode.EPHEMERAL;

    case 2: return CreateMode.PERSISTENT_SEQUENTIAL;

    case 3: return CreateMode.EPHEMERAL_SEQUENTIAL ;

    default:
      LOG.error("Received an invalid flag value to convert to a CreateMode");
      throw new KeeperException.BadArgumentsException(); 
    }
  }
}
origin: facebook/jcommon

public synchronized void delete(String path, int expectedVersion) throws KeeperException {
 if (isRootPath(path)) {
  throw new KeeperException.BadArgumentsException(path);
 }
 String relativePath = stripRootFromPath(path);
 root.deleteDescendant(relativePath, expectedVersion);
}
origin: org.apache.zookeeper/zookeeper

String path = existsRequest.getPath();
if (path.indexOf('\0') != -1) {
  throw new KeeperException.BadArgumentsException();
origin: org.apache.zookeeper/zookeeper

  LOG.info("Invalid path " + path + " with session 0x" +
      Long.toHexString(request.sessionId));
  throw new KeeperException.BadArgumentsException(path);
if (lastSlash == -1 || path.indexOf('\0') != -1
    || zks.getZKDatabase().isSpecialPath(path)) {
  throw new KeeperException.BadArgumentsException(path);
origin: org.apache.zookeeper/zookeeper

  return new OperationTimeoutException();
case BADARGUMENTS:
  return new BadArgumentsException();
case APIERROR:
  return new APIErrorException();
origin: apache/zookeeper

    request.qv.setVersion(request.getHdr().getZxid());
  } catch (IOException | ConfigException e) {
    throw new KeeperException.BadArgumentsException(e.getMessage());
      String msg = "Incremental reconfiguration requested but last configuration seen has a non-majority quorum system";
      LOG.warn(msg);
      throw new KeeperException.BadArgumentsException(msg);
          throw new KeeperException.BadArgumentsException("Wrong format of server string");
        QuorumServer qs = new QuorumServer(sid, parts[1]);
        if (qs.clientAddr == null || qs.electionAddr == null || qs.addr == null) {
          throw new KeeperException.BadArgumentsException("Wrong format of server string - each server should have 3 ports specified");
    throw new KeeperException.BadArgumentsException("Reconfiguration failed");
  String msg = "Reconfig failed - new configuration must include at least 2 followers";
  LOG.warn(msg);
  throw new KeeperException.BadArgumentsException(msg);
} else if (request.qv.getVotingMembers().size() < 1) {
  String msg = "Reconfig failed - new configuration must include at least 1 follower";
  LOG.warn(msg);
  throw new KeeperException.BadArgumentsException(msg);
origin: apache/zookeeper

path = existsRequest.getPath();
if (path.indexOf('\0') != -1) {
  throw new KeeperException.BadArgumentsException();
origin: apache/zookeeper

  return new ReconfigInProgress();
case BADARGUMENTS:
  return new BadArgumentsException();
case APIERROR:
  return new APIErrorException();
origin: org.apache.zookeeper/zookeeper

  /**
   * Map an integer value to a CreateMode value
   */
  static public CreateMode fromFlag(int flag) throws KeeperException {
    switch(flag) {
    case 0: return CreateMode.PERSISTENT;

    case 1: return CreateMode.EPHEMERAL;

    case 2: return CreateMode.PERSISTENT_SEQUENTIAL;

    case 3: return CreateMode.EPHEMERAL_SEQUENTIAL ;

    default:
      String errMsg = "Received an invalid flag value: " + flag
          + " to convert to a CreateMode";
      LOG.error(errMsg);
      throw new KeeperException.BadArgumentsException(errMsg);
    }
  }
}
origin: apache/zookeeper

private void validateCreateRequest(String path, CreateMode createMode, Request request, long ttl)
    throws KeeperException {
  if (createMode.isTTL() && !EphemeralType.extendedEphemeralTypesEnabled()) {
    throw new KeeperException.UnimplementedException();
  }
  try {
    EphemeralType.validateTTL(createMode, ttl);
  } catch (IllegalArgumentException e) {
    throw new BadArgumentsException(path);
  }
  if (createMode.isEphemeral()) {
    // Exception is set when local session failed to upgrade
    // so we just need to report the error
    if (request.getException() != null) {
      throw request.getException();
    }
    zks.sessionTracker.checkGlobalSession(request.sessionId,
        request.getOwner());
  } else {
    zks.sessionTracker.checkSession(request.sessionId,
        request.getOwner());
  }
}
origin: org.apache.zookeeper/zookeeper

private void validatePath(String path, long sessionId) throws BadArgumentsException {
  try {
    PathUtils.validatePath(path);
  } catch(IllegalArgumentException ie) {
    LOG.info("Invalid path " +  path + " with session 0x" + Long.toHexString(sessionId) +
        ", reason: " + ie.getMessage());
    throw new BadArgumentsException(path);
  }
}
origin: apache/zookeeper

/**
 * Map an integer value to a CreateMode value
 */
static public CreateMode fromFlag(int flag) throws KeeperException {
  switch(flag) {
  case 0: return CreateMode.PERSISTENT;
  case 1: return CreateMode.EPHEMERAL;
  case 2: return CreateMode.PERSISTENT_SEQUENTIAL;
  case 3: return CreateMode.EPHEMERAL_SEQUENTIAL ;
  case 4: return CreateMode.CONTAINER;
  case 5: return CreateMode.PERSISTENT_WITH_TTL;
  case 6: return CreateMode.PERSISTENT_SEQUENTIAL_WITH_TTL;
  default:
    String errMsg = "Received an invalid flag value: " + flag
        + " to convert to a CreateMode";
    LOG.error(errMsg);
    throw new KeeperException.BadArgumentsException(errMsg);
  }
}
origin: apache/zookeeper

private String getParentPathAndValidate(String path)
    throws BadArgumentsException {
  int lastSlash = path.lastIndexOf('/');
  if (lastSlash == -1 || path.indexOf('\0') != -1
      || zks.getZKDatabase().isSpecialPath(path)) {
    throw new BadArgumentsException(path);
  }
  return path.substring(0, lastSlash);
}
org.apache.zookeeperKeeperException$BadArgumentsException<init>

Popular methods of KeeperException$BadArgumentsException

  • getPath

Popular in Java

  • Reading from database using SQL prepared statement
  • getSupportFragmentManager (FragmentActivity)
  • onCreateOptionsMenu (Activity)
  • addToBackStack (FragmentTransaction)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • JTextField (javax.swing)
  • Runner (org.openjdk.jmh.runner)
  • 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