Package com.alibaba.wasp

Examples of com.alibaba.wasp.ServerName


    CollectingVisitor<Result> v = new CollectingVisitor<Result>() {
      @Override
      void add(Result r) {
        if (r == null || r.isEmpty())
          return;
        ServerName sn = ServerName.getServerName(r);
        if (sn != null && sn.equals(serverName))
          this.results.add(r);
      }
    };
    fullScan(v);
    List<Result> results = v.getResults();
View Full Code Here


            if (LOG.isDebugEnabled()) {
              LOG.debug("EntityGroupInfo : " + info.toString());
            }
            if (Bytes.equals(info.getTableName(), rootTableName)) {
              // find it, so end search
              ServerName sn = ServerName.getServerName(r);
              EntityGroupLocation egLoc = new EntityGroupLocation(info,
                  sn.getHostname(), sn.getPort());
              results.add(egLoc);
              return false;
            }
            return true;
          }
        };
        // Run full scan of _FMETA_ catalog table passing in our custom visitor
        fullScan(visitor, rootTableName, null);
        return results.size() == 0 ? null : results.get(0);
      } else {
        EntityGroupInfo info = EntityGroupInfo.getEntityGroupInfo(r);
        if (info == null) {
          throw new TableNotFoundException(Bytes.toString(tableName));
        }
        ServerName sn = ServerName.getServerName(r);
        EntityGroupLocation egLoc = new EntityGroupLocation(info,
            sn.getHostname(), sn.getPort());
        return egLoc;
      }
    } catch (IOException e) {
      throw new MetaException(e);
    }
View Full Code Here

  private void add(final List<String> servers) throws IOException {
    synchronized(this.drainingServers) {
      this.drainingServers.clear();
      for (String n: servers) {
        final ServerName sn = new ServerName(ZKUtil.getNodeName(n));
        this.drainingServers.add(sn);
        this.serverManager.addServerToDrainList(sn);
        LOG.info("Draining RS node created, adding to list [" +
            sn + "]");
View Full Code Here

  }

  @Override
  public void nodeDeleted(final String path) {
    if(path.startsWith(watcher.drainingZNode)) {
      final ServerName sn = new ServerName(ZKUtil.getNodeName(path));
      LOG.info("Draining RS node deleted, removing from list [" +
          sn + "]");
      remove(sn);
    }
  }
View Full Code Here

        }
        if (!Bytes.equals(eginfo.getTableName(), tableName)) {
          // this is another table, we can exit search.
          return false;
        }
        ServerName sn = ServerName.getServerName(r);
        EntityGroupLocation egLoc = new EntityGroupLocation(eginfo,
            sn.getHostname(), sn.getPort());
        egLocations.add(egLoc);
        // Returning true means "keep scanning"
        return true;
      }
    };
View Full Code Here

        }
        if (!Bytes.equals(egi.getTableName(), tableName)) {
          // this is another table, we can exit search.
          return false;
        }
        ServerName sn = ServerName.getServerName(r);
        entityGroupInfos.add(new Pair<EntityGroupInfo, ServerName>(egi, sn));
        // Returning true means "keep scanning"
        return true;
      }
    };
View Full Code Here

      @Override
      public boolean processRow(Result row) throws IOException {
        EntityGroupInfo info = FMetaScanner.getEntityGroupInfo(row);
        if (info != null) {
          if (Bytes.equals(tableName, info.getTableName())) {
            ServerName sn = ServerName.getServerName(row);
            if (sn == null) {
              available.set(false);
              return false;
            }
            entityGroupCount.incrementAndGet();
View Full Code Here

    try {
      Stat stat = new Stat();
      byte[] data = ZKUtil.getDataNoWatch(zkw, zkw.getMasterAddressZNode(),
          stat);
      ServerName sn = ServerName.parseFrom(data);
      if (sn != null && content.equals(sn.toString())) {
        return (ZKUtil.deleteNode(zkw, zkw.getMasterAddressZNode(),
            stat.getVersion()));
      }
    } catch (KeeperException e) {
      LOG.warn("Can't get or delete the master znode", e);
View Full Code Here

      super("AssignmentTimerUpdater", period, stopper);
    }

    @Override
    protected void chore() {
      ServerName serverToUpdateTimer = null;
      while (!serversInUpdatingTimer.isEmpty() && !stopper.isStopped()) {
        if (serverToUpdateTimer == null) {
          serverToUpdateTimer = serversInUpdatingTimer.first();
        } else {
          serverToUpdateTimer = serversInUpdatingTimer
View Full Code Here

        FServerStatusProtocol.class, FMetaServerProtocol.class},
        initialIsa.getHostName(), // BindAddress is IP we got for this server.
        initialIsa.getPort(), conf);
    // Set our address.
    this.isa = this.rpcServer.getListenerAddress();
    this.serverName = new ServerName(this.isa.getHostName(),
        this.isa.getPort(), System.currentTimeMillis());

    // set the thread name now we have an address
    setName(MASTER + "-" + this.serverName.toString());
View Full Code Here

TOP

Related Classes of com.alibaba.wasp.ServerName

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.