Package com.github.youtube.vitess.jdbc.vtocc.QueryService.SessionParams

Examples of com.github.youtube.vitess.jdbc.vtocc.QueryService.SessionParams.Builder


   */
  void init() throws SQLException {
    try {
      // lazy session creation to allow creation of VtoccTransactionHandler via Provider
      if (sessionInfo == null) {
        Builder sessionParams = SessionParams.newBuilder();
        Matcher matcher = Pattern.compile("([^/]*)(?:/(\\d+))?").matcher(vtoccKeyspaceShard);
        if (!matcher.matches()) {
          throw new IllegalArgumentException("Invalid keyspace/shard " + vtoccKeyspaceShard);
        }
        sessionParams.setKeyspace(matcher.group(1));
        if (matcher.group(2) != null) {
          sessionParams.setShard(matcher.group(2));
        }

        sessionInfo = sqlQueryBlockingInterface
            .getSessionId(rpcControllerProvider.get(), sessionParams.build());
      }
    } catch (ServiceException e) {
      throw VtoccSqlExceptionFactory.getSqlException(e);
    }
  }
View Full Code Here

TOP

Related Classes of com.github.youtube.vitess.jdbc.vtocc.QueryService.SessionParams.Builder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.