Package org.apache.accumulo.server.master.LiveTServerSet

Examples of org.apache.accumulo.server.master.LiveTServerSet.TServerConnection


      final String tableId = checkTableId(tableName, TableOperation.FLUSH);
      verify(c, check(c, tableId, TablePermission.WRITE) || check(c, tableId, TablePermission.ALTER_TABLE));
     
      for (TServerInstance instance : tserverSet.getCurrentServers()) {
        try {
          final TServerConnection server = tserverSet.getConnection(instance);
          if (server != null)
            server.flush(masterLock, tableId);
        } catch (TException ex) {
          log.error(ex.toString());
        }
      }
    }
View Full Code Here


    public void shutdownTabletServer(TInfo info, AuthInfo c, String tabletServer) throws ThriftSecurityException, TException {
      verify(c, check(c, SystemPermission.SYSTEM));
     
      final InetSocketAddress addr = AddressUtil.parseAddress(tabletServer, Property.TSERV_CLIENTPORT);
      final TServerInstance doomed = tserverSet.find(AddressUtil.toString(addr));
      final TServerConnection server = tserverSet.getConnection(doomed);
      if (server == null) {
        log.warn("No server found for name " + tabletServer);
        return;
      }
     
View Full Code Here

                  assigned.add(new Assignment(tls.extent, tls.future));
                  break;
              }
            } else {
              if (state != TabletState.UNASSIGNED) {
                TServerConnection conn = tserverSet.getConnection(server);
                if (conn != null) {
                  conn.unloadTablet(masterLock, tls.extent, goal != TabletGoalState.DELETED);
                  unloaded++;
                  totalUnloaded++;
                } else {
                  log.warn("Could not connect to server " + server);
                }
View Full Code Here

        log.info(String.format("Assigning %d tablets", assignments.size()));
        store.setFutureLocations(assignments);
      }
      assignments.addAll(assigned);
      for (Assignment a : assignments) {
        TServerConnection conn = tserverSet.getConnection(a.server);
        if (conn != null) {
          conn.assignTablet(masterLock, a.tablet);
        } else {
          log.warn("Could not connect to server " + a.server);
        }
      }
    }
View Full Code Here

      loggerBalancer.balance(logUsers, logNames, assignmentsOut, loggersPerServer);
      for (Entry<LoggerUser,List<String>> entry : assignmentsOut.entrySet()) {
        TServerUsesLoggers tserver = (TServerUsesLoggers) entry.getKey();
        try {
          log.debug("Telling " + tserver.getInstance() + " to use loggers " + entry.getValue());
          TServerConnection connection = tserverSet.getConnection(tserver.getInstance());
          if (connection != null)
            connection.useLoggers(new HashSet<String>(entry.getValue()));
        } catch (Exception ex) {
          log.warn("Unable to talk to " + tserver.getInstance(), ex);
        }
      }
    }
View Full Code Here

        copyServersToShutdown.addAll(serversToShutdown);
      }
      for (TServerInstance doomed : copyServersToShutdown) {
        final String path = ZooUtil.getRoot(instance) + Constants.ZDOOMEDSERVERS + "/" + doomed.hostPort();
        try {
          TServerConnection server = tserverSet.getConnection(doomed);
          if (server != null) {
            TabletServerStatus status = server.getTableMap();
            if (status.tableMap != null && status.tableMap.size() > 0) {
              continue;
            }
            server.halt(masterLock);
          }
          // remove from original (not copy)
          serversToShutdown.remove(doomed);
          tserverSet.remove(doomed);
          try {
View Full Code Here

     
      for (long l = 0; l < maxLoops; l++) {
       
        for (TServerInstance instance : serversToFlush) {
          try {
            final TServerConnection server = tserverSet.getConnection(instance);
            if (server != null)
              server.flush(masterLock, tableId, ByteBufferUtil.toBytes(startRow), ByteBufferUtil.toBytes(endRow));
          } catch (TException ex) {
            log.error(ex.toString());
          }
        }
       
View Full Code Here

     
      final InetSocketAddress addr = AddressUtil.parseAddress(tabletServer, Property.TSERV_CLIENTPORT);
      final String addrString = org.apache.accumulo.core.util.AddressUtil.toString(addr);
      final TServerInstance doomed = tserverSet.find(addrString);
      if (!force) {
        final TServerConnection server = tserverSet.getConnection(doomed);
        if (server == null) {
          log.warn("No server found for name " + tabletServer);
          return;
        }
      }
View Full Code Here

                case ASSIGNED_TO_DEAD_SERVER:
                  assignedToDeadServers.add(tls);
                  // log.info("Current servers " + currentTServers.keySet());
                  break;
                case HOSTED:
                  TServerConnection conn = tserverSet.getConnection(server);
                  if (conn != null) {
                    conn.unloadTablet(masterLock, tls.extent, goal != TabletGoalState.DELETED);
                    unloaded++;
                    totalUnloaded++;
                  } else {
                    log.warn("Could not connect to server " + server);
                  }
View Full Code Here

          if (splitPoint.equals(tls.extent.getEndRow()))
            continue;
          if (splitPoint.equals(tls.extent.getPrevEndRow()))
            continue;
          try {
            TServerConnection conn;
            conn = tserverSet.getConnection(tls.current);
            if (conn != null) {
              log.info("Asking " + tls.current + " to split " + tls.extent + " at " + splitPoint);
              conn.splitTablet(masterLock, tls.extent, splitPoint);
            } else {
              log.warn("Not connected to server " + tls.current);
            }
          } catch (Exception e) {
            log.warn("Error asking tablet server to split a tablet: " + e);
View Full Code Here

TOP

Related Classes of org.apache.accumulo.server.master.LiveTServerSet.TServerConnection

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.