Package org.apache.hadoop.hbase.ipc

Examples of org.apache.hadoop.hbase.ipc.TransactionalRegionInterface


    boolean allReadOnly = true;
    try {
      Iterator<HRegionLocation> locationIterator = transactionState.getParticipatingRegions().iterator();
      while (locationIterator.hasNext()) {
        HRegionLocation location = locationIterator.next();
        TransactionalRegionInterface transactionalRegionServer = (TransactionalRegionInterface) connection
            .getHRegionConnection(location.getServerAddress());
        int commitStatus = transactionalRegionServer.commitRequest(location
            .getRegionInfo().getRegionName(), transactionState
            .getTransactionId());
        boolean canCommit = true;
        switch (commitStatus) {
        case TransactionalRegionInterface.COMMIT_OK:
View Full Code Here


      transactionLogger.setStatusForTransaction(transactionState
          .getTransactionId(), TransactionLogger.TransactionStatus.COMMITTED);

      for (HRegionLocation location : transactionState
          .getParticipatingRegions()) {
        TransactionalRegionInterface transactionalRegionServer = (TransactionalRegionInterface) connection
            .getHRegionConnection(location.getServerAddress());
        transactionalRegionServer.commit(location.getRegionInfo()
            .getRegionName(), transactionState.getTransactionId());
      }
    } catch (Exception e) {
      LOG.debug("Commit of transaction [" + transactionState.getTransactionId()
          + "] was unsucsessful", e);
View Full Code Here

    for (HRegionLocation location : transactionState.getParticipatingRegions()) {
      if (locationToIgnore != null && location.equals(locationToIgnore)) {
        continue;
      }
      try {
        TransactionalRegionInterface transactionalRegionServer = (TransactionalRegionInterface) connection
            .getHRegionConnection(location.getServerAddress());

        transactionalRegionServer.abort(location.getRegionInfo()
            .getRegionName(), transactionState.getTransactionId());
      } catch (UnknownTransactionException e) {
        LOG
            .debug("Got unknown transaciton exception durring abort. Transaction: ["
                + transactionState.getTransactionId()
View Full Code Here

    boolean allReadOnly = true;
    try {
      Iterator<HRegionLocation> locationIterator = transactionState.getParticipatingRegions().iterator();
      while (locationIterator.hasNext()) {
        HRegionLocation location = locationIterator.next();
        TransactionalRegionInterface transactionalRegionServer = (TransactionalRegionInterface) connection
            .getHRegionConnection(location.getServerAddress());
        int commitStatus = transactionalRegionServer.commitRequest(location
            .getRegionInfo().getRegionName(), transactionState
            .getTransactionId());
        boolean canCommit = true;
        switch (commitStatus) {
        case TransactionalRegionInterface.COMMIT_OK:
View Full Code Here

      transactionLogger.setStatusForTransaction(transactionState
          .getTransactionId(), TransactionLogger.TransactionStatus.COMMITTED);

      for (HRegionLocation location : transactionState
          .getParticipatingRegions()) {
        TransactionalRegionInterface transactionalRegionServer = (TransactionalRegionInterface) connection
            .getHRegionConnection(location.getServerAddress());
        transactionalRegionServer.commit(location.getRegionInfo()
            .getRegionName(), transactionState.getTransactionId());
      }
    } catch (Exception e) {
      LOG.debug("Commit of transaction [" + transactionState.getTransactionId()
          + "] was unsucsessful", e);
View Full Code Here

    for (HRegionLocation location : transactionState.getParticipatingRegions()) {
      if (locationToIgnore != null && location.equals(locationToIgnore)) {
        continue;
      }
      try {
        TransactionalRegionInterface transactionalRegionServer = (TransactionalRegionInterface) connection
            .getHRegionConnection(location.getServerAddress());

        transactionalRegionServer.abort(location.getRegionInfo()
            .getRegionName(), transactionState.getTransactionId());
      } catch (UnknownTransactionException e) {
        LOG
            .debug("Got unknown transaciton exception durring abort. Transaction: ["
                + transactionState.getTransactionId()
View Full Code Here

    LOG.debug("atempting to commit trasaction: " + transactionState.toString());

    try {
      for (HRegionLocation location : transactionState
          .getParticipatingRegions()) {
        TransactionalRegionInterface transactionalRegionServer = (TransactionalRegionInterface) connection
            .getHRegionConnection(location.getServerAddress());
        boolean canCommit = transactionalRegionServer.commitRequest(location
            .getRegionInfo().getRegionName(), transactionState
            .getTransactionId());
        if (LOG.isTraceEnabled()) {
          LOG.trace("Region ["
              + location.getRegionInfo().getRegionNameAsString() + "] votes "
              + (canCommit ? "to commit" : "to abort") + " transaction "
              + transactionState.getTransactionId());
        }

        if (!canCommit) {
          LOG.debug("Aborting [" + transactionState.getTransactionId() + "]");
          abort(transactionState, location);
          throw new CommitUnsuccessfulException();
        }
      }

      LOG.debug("Commiting [" + transactionState.getTransactionId() + "]");

      transactionLogger.setStatusForTransaction(transactionState
          .getTransactionId(), TransactionLogger.TransactionStatus.COMMITTED);

      for (HRegionLocation location : transactionState
          .getParticipatingRegions()) {
        TransactionalRegionInterface transactionalRegionServer = (TransactionalRegionInterface) connection
            .getHRegionConnection(location.getServerAddress());
        transactionalRegionServer.commit(location.getRegionInfo()
            .getRegionName(), transactionState.getTransactionId());
      }
    } catch (RemoteException e) {
      LOG.debug("Commit of transaction [" + transactionState.getTransactionId()
          + "] was unsucsessful", e);
View Full Code Here

    for (HRegionLocation location : transactionState.getParticipatingRegions()) {
      if (locationToIgnore != null && location.equals(locationToIgnore)) {
        continue;
      }

      TransactionalRegionInterface transactionalRegionServer = (TransactionalRegionInterface) connection
          .getHRegionConnection(location.getServerAddress());

      transactionalRegionServer.abort(location.getRegionInfo().getRegionName(),
          transactionState.getTransactionId());
    }
  }
View Full Code Here

    boolean allReadOnly = true;
    try {
      Iterator<HRegionLocation> locationIterator = transactionState.getParticipatingRegions().iterator();
      while (locationIterator.hasNext()) {
        HRegionLocation location = locationIterator.next();
        TransactionalRegionInterface transactionalRegionServer = (TransactionalRegionInterface) connection
            .getHRegionConnection(location.getServerAddress());
        int commitStatus = transactionalRegionServer.commitRequest(location
            .getRegionInfo().getRegionName(), transactionState
            .getTransactionId());
        boolean canCommit = true;
        switch (commitStatus) {
        case TransactionalRegionInterface.COMMIT_OK:
View Full Code Here

      transactionLogger.setStatusForTransaction(transactionState
          .getTransactionId(), TransactionLogger.TransactionStatus.COMMITTED);

      for (HRegionLocation location : transactionState
          .getParticipatingRegions()) {
        TransactionalRegionInterface transactionalRegionServer = (TransactionalRegionInterface) connection
            .getHRegionConnection(location.getServerAddress());
        transactionalRegionServer.commit(location.getRegionInfo()
            .getRegionName(), transactionState.getTransactionId());
      }
    } catch (Exception e) {
      LOG.debug("Commit of transaction [" + transactionState.getTransactionId()
          + "] was unsucsessful", e);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.ipc.TransactionalRegionInterface

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.