Package org.apache.zookeeper_voltpatches.txn

Examples of org.apache.zookeeper_voltpatches.txn.ErrorTxn


  }
  public int compareTo (Object peer_) throws ClassCastException {
    if (!(peer_ instanceof ErrorTxn)) {
      throw new ClassCastException("Comparing different types of records.");
    }
    ErrorTxn peer = (ErrorTxn) peer_;
    int ret = 0;
    ret = (err == peer.err)? 0 :((err<peer.err)?-1:1);
    if (ret != 0) return ret;
     return ret;
  }
View Full Code Here


      return false;
    }
    if (peer_ == this) {
      return true;
    }
    ErrorTxn peer = (ErrorTxn) peer_;
    boolean ret = false;
    ret = (err==peer.err);
    if (!ret) return ret;
     return ret;
  }
View Full Code Here

            default:
            }
        } catch (KeeperException e) {
            if (txnHeader != null) {
                txnHeader.setType(OpCode.error);
                txn = new ErrorTxn(e.code().intValue());
            }
            LOG.debug("Got user-level KeeperException when processing "
                    + request.toString() + " Error Path:" + e.getPath()
                    + " Error:" + e.getMessage());
            request.setException(e);
        } catch (Exception e) {
            // log at error level as we are returning a marshalling
            // error to the user
            LOG.error("Failed to process " + request, e);

            StringBuilder sb = new StringBuilder();
            ByteBuffer bb = request.request;
            if (bb != null) {
                bb.rewind();
                while (bb.hasRemaining()) {
                    sb.append(Integer.toHexString(bb.get() & 0xff));
                }
            } else {
                sb.append("request buffer is null");
            }

            LOG.error("Dumping request buffer: 0x" + sb.toString());
            if (txnHeader != null) {
                txnHeader.setType(OpCode.error);
                txn = new ErrorTxn(Code.MARSHALLINGERROR.intValue());
            }
        }
        request.hdr = txnHeader;
        request.txn = txn;
        request.zxid = txnId;
View Full Code Here

                    break;
                case OpCode.closeSession:
                    killSession(header.getClientId(), header.getZxid());
                    break;
                case OpCode.error:
                    ErrorTxn errTxn = (ErrorTxn) txn;
                    rc.err = errTxn.getErr();
                    break;
            }
        } catch (KeeperException e) {
            // These are expected errors since we take a lazy snapshot
            if (initialized
View Full Code Here

            break;
        case OpCode.setACL:
            txn = new SetACLTxn();
            break;
        case OpCode.error:
            txn = new ErrorTxn();
            break;
        }
        if (txn != null) {
            txn.deserialize(ia, "txn");
        }
View Full Code Here

TOP

Related Classes of org.apache.zookeeper_voltpatches.txn.ErrorTxn

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.