Package com.alibaba.wasp

Examples of com.alibaba.wasp.EntityGroupInfo


        queryResultProtos.clear();

        GetAction action = plan.getGetAction();
        EntityGroupLocation entityGroupLocation = action
            .getEntityGroupLocation();
        EntityGroupInfo entityGroupInfo = entityGroupLocation
            .getEntityGroupInfo();
        ServerName serverName = new ServerName(
            entityGroupLocation.getHostname(), entityGroupLocation.getPort(),
            ServerName.NON_STARTCODE);
        ClientProtos.GetResponse response = null;
        // local
        boolean localGet = workingOnLocalServer(server, serverName);
        if (localGet) {// if the target entityGroup's server is current
                       // server, run it in local.
          response = server.get(entityGroupInfo.getEntityGroupName(), action);
        } else {// rpc
          ClientProtocol clientProtocol = connection.getClient(
              serverName.getHostname(), serverName.getPort());
          response = clientProtocol.get(null,
              RequestConverter.buildGetRequest(action));
View Full Code Here


      return this.found;
    }

    @Override
    public boolean visit(Result r) throws IOException {
      EntityGroupInfo egi = EntityGroupInfo.getEntityGroupInfo(r);
      if (egi == null) {
        LOG.warn("No serialized EntityGroupInfo in " + r);
        return true;
      }
      byte[] value = r.getValue(FConstants.CATALOG_FAMILY,
          FConstants.EGLOCATION);
      // See if daughter is assigned to some server
      if (value == null)
        return false;

      // Now see if we have gone beyond the daughter's startrow.
      if (!Bytes.equals(daughter.getTableName(), egi.getTableName())) {
        // We fell into another table. Stop scanning.
        return false;
      }
      // If our start rows do not compare, move on.
      if (!Bytes.equals(daughter.getStartKey(), egi.getStartKey())) {
        return false;
      }
      // Else, table name and start rows compare. It means that the daughter
      // or some derivative split of the daughter is up in .FMETA. Daughter
      // exists.
View Full Code Here

      try {
        queryResultProtos.clear();
        ScanAction action = plan.getScanAction();
        EntityGroupLocation entityGroupLocation = action
            .getEntityGroupLocation();
        EntityGroupInfo entityGroupInfo = entityGroupLocation
            .getEntityGroupInfo();
        serverName = new ServerName(entityGroupLocation.getHostname(),
            entityGroupLocation.getPort(), ServerName.NON_STARTCODE);
        ClientProtos.ScanResponse response = null;
        // local
        localScan = workingOnLocalServer(server, serverName);
        do {
          if (localScan) {// if the target entityGroup's server is current
                          // server, run it in local.
            response = server.scan(entityGroupInfo.getEntityGroupName(),
                action, scannerId == -1 ? false : true, scannerId, false);
            scannerId = response.getScannerId();
          } else {// rpc
            ClientProtocol clientProtocol = connection.getClient(
                serverName.getHostname(), serverName.getPort());
View Full Code Here

      public boolean visit(Result r) throws IOException {
        if (r == null || r.isEmpty()) {
          return true;
        }
        byte[] value = r.getValue(FConstants.CATALOG_FAMILY, FConstants.EGINFO);
        EntityGroupInfo eginfo = EntityGroupInfo.parseFromOrNull(value);
        if (eginfo == null) {
          return true;
        }
        if (!Bytes.equals(eginfo.getTableName(), tableByte)) {
          // this is another table, we can exit search.
          return false;
        }
        entityGroupInfos.add(eginfo);
        // Returning true means "keep scanning"
View Full Code Here

          byte[] locationValue = r.getValue(FConstants.CATALOG_FAMILY,
              FConstants.EGLOCATION);
          Pair<EntityGroupInfo, ServerName> eginfoSN = new Pair<EntityGroupInfo, ServerName>(
              EntityGroupInfo.parseFromOrNull(infoValue),
              ServerName.convert(locationValue));
          EntityGroupInfo eginfo = eginfoSN.getFirst();
          if (eginfo == null) {
            return true;
          }
          if (eginfo.getTableNameAsString() == null) {
            return true;
          }
          if (disabledTables.contains(eginfo.getTableNameAsString())) {
            return true;
          }
          // Are we to include split parents in the list?
          if (excludeOfflinedSplitParents && eginfo.isSplitParent()) {
            return true;
          }
          entityGroups.put(eginfo, eginfoSN.getSecond());
          return true;
        } catch (DeserializationException de) {
View Full Code Here

      @Override
      public boolean visit(Result r) throws IOException {
        if (r == null || r.isEmpty()) {
          return true;
        }
        EntityGroupInfo eginfo = EntityGroupInfo.getEntityGroupInfo(r);
        if (eginfo == null) {
          return true;
        }
        if (LOG.isDebugEnabled()) {
          LOG.debug("EntityGroupInfo : " + eginfo.toString());
        }
        entityGroups.add(eginfo);
        return true;
      }
    };
View Full Code Here

      @Override
      public boolean visit(Result r) throws IOException {
        if (r == null || r.isEmpty()) {
          return true;
        }
        EntityGroupInfo info = EntityGroupInfo.getEntityGroupInfo(r);
        if (info == null) {
          return true; // Keep scanning
        }
        if (info.isOffline() && info.isSplit()) {
          offlineSplitParents.put(info, r);
        }
        // Returning true means "keep scanning"
        return true;
      }
View Full Code Here

   */
  public static EntityGroupInfo getEntityGroupInfo(Result data) {
    byte[] bytes = data.getValue(FConstants.CATALOG_FAMILY, FConstants.EGINFO);
    if (bytes == null)
      return null;
    EntityGroupInfo info = EntityGroupInfo.parseFromOrNull(bytes);
    if (LOG.isDebugEnabled()) {
      LOG.debug("Current INFO from scan results = " + info);
    }
    return info;
  }
View Full Code Here

      public boolean processRowInternal(Result result) throws IOException {
        if (result == null || result.isEmpty()) {
          return true;
        }

        EntityGroupInfo entityGroupInfo = getEntityGroupInfo(result);
        if (entityGroupInfo == null) {
          LOG.warn("Null ENTITYGROUPINFO_QUALIFIER: " + result);
          return true;
        }

        // If entityGroup offline AND we are not to include offlined entityGroups,
        // return.
        if (entityGroupInfo.isOffline() && !offlined)
          return true;
        entityGroups.add(entityGroupInfo);
        return true;
      }
    };
View Full Code Here

    final NavigableMap<EntityGroupInfo, ServerName> entityGroups = new TreeMap<EntityGroupInfo, ServerName>();
    MetaScannerVisitor visitor = new TableMetaScannerVisitor(conf,
        parentTableName) {
      @Override
      public boolean processRowInternal(Result rowResult) throws IOException {
        EntityGroupInfo entityGroupInfo = getEntityGroupInfo(rowResult);
        ServerName sn = ServerName.getServerName(rowResult);

        if (!(entityGroupInfo.isOffline() || entityGroupInfo.isSplit())) {
          entityGroups.put(entityGroupInfo, sn);
        }
        return true;
      }
    };
View Full Code Here

TOP

Related Classes of com.alibaba.wasp.EntityGroupInfo

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.