Class PrepRequestProcessor

  • All Implemented Interfaces:
    java.lang.Runnable, RequestProcessor

    public class PrepRequestProcessor
    extends ZooKeeperCriticalThread
    implements RequestProcessor
    This request processor is generally at the start of a RequestProcessor change. It sets up any transactions associated with requests that change the state of the system. It counts on ZooKeeperServer to update outstandingRequests, so that it can take into account transactions that are in the queue to be applied when generating a transaction.
    • Field Summary

      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addChangeRecord​(org.apache.zookeeper.server.ZooKeeperServer.ChangeRecord c)  
      static java.util.List<ACL> fixupACL​(java.lang.String path, java.util.List<Id> authInfo, java.util.List<ACL> acls)
      This method checks out the acl making sure it isn't null or empty, it has valid schemes and ids, and expanding any relative ids that depend on the requestor's authentication information.
      protected void pRequest​(Request request)
      This method will be called inside the ProcessRequestThread, which is a singleton, so there will be a single thread calling this code.
      protected void pRequest2Txn​(int type, long zxid, Request request, Record record, boolean deserialize)
      This method will be called inside the ProcessRequestThread, which is a singleton, so there will be a single thread calling this code.
      void processRequest​(Request request)  
      void run()  
      static void setFailCreate​(boolean b)
      method for tests to set failCreate
      void shutdown()  
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • setFailCreate

        public static void setFailCreate​(boolean b)
        method for tests to set failCreate
        Parameters:
        b -
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread
      • addChangeRecord

        protected void addChangeRecord​(org.apache.zookeeper.server.ZooKeeperServer.ChangeRecord c)
      • fixupACL

        public static java.util.List<ACL> fixupACL​(java.lang.String path,
                                                   java.util.List<Id> authInfo,
                                                   java.util.List<ACL> acls)
                                            throws KeeperException.InvalidACLException
        This method checks out the acl making sure it isn't null or empty, it has valid schemes and ids, and expanding any relative ids that depend on the requestor's authentication information.
        Parameters:
        authInfo - list of ACL IDs associated with the client connection
        acls - list of ACLs being assigned to the node (create or setACL operation)
        Returns:
        verified and expanded ACLs
        Throws:
        KeeperException.InvalidACLException