Package org.apache.zookeeper.server
Class PrepRequestProcessor
- java.lang.Object
- 
- java.lang.Thread
- 
- org.apache.zookeeper.server.ZooKeeperThread
- 
- org.apache.zookeeper.server.ZooKeeperCriticalThread
- 
- org.apache.zookeeper.server.PrepRequestProcessor
 
 
 
 
- 
- All Implemented Interfaces:
- 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.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classPrepRequestProcessor.DigestOpCode- 
Nested classes/interfaces inherited from class java.lang.ThreadThread.State, Thread.UncaughtExceptionHandler
 - 
Nested classes/interfaces inherited from interface org.apache.zookeeper.server.RequestProcessorRequestProcessor.RequestProcessorException
 
- 
 - 
Field Summary- 
Fields inherited from class java.lang.ThreadMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
- 
 - 
Constructor SummaryConstructors Constructor Description PrepRequestProcessor(ZooKeeperServer zks, RequestProcessor nextProcessor)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddChangeRecord(org.apache.zookeeper.server.ZooKeeperServer.ChangeRecord c)static List<ACL>fixupACL(String path, List<Id> authInfo, 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 voidpRequest(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 voidpRequest2Txn(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.voidprocessRequest(Request request)voidrun()static voidsetFailCreate(boolean b)method for tests to set failCreatevoidshutdown()- 
Methods inherited from class org.apache.zookeeper.server.ZooKeeperCriticalThreadhandleException
 - 
Methods inherited from class java.lang.ThreadactiveCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
- 
 
- 
- 
- 
Constructor Detail- 
PrepRequestProcessorpublic PrepRequestProcessor(ZooKeeperServer zks, RequestProcessor nextProcessor) 
 
- 
 - 
Method Detail- 
setFailCreatepublic static void setFailCreate(boolean b) method for tests to set failCreate- Parameters:
- b-
 
 - 
addChangeRecordprotected void addChangeRecord(org.apache.zookeeper.server.ZooKeeperServer.ChangeRecord c) 
 - 
pRequest2Txnprotected void pRequest2Txn(int type, long zxid, Request request, Record record, boolean deserialize) throws KeeperException, IOException, RequestProcessor.RequestProcessorExceptionThis method will be called inside the ProcessRequestThread, which is a singleton, so there will be a single thread calling this code.- Parameters:
- type-
- zxid-
- request-
- record-
- Throws:
- KeeperException
- IOException
- RequestProcessor.RequestProcessorException
 
 - 
pRequestprotected void pRequest(Request request) throws RequestProcessor.RequestProcessorException This method will be called inside the ProcessRequestThread, which is a singleton, so there will be a single thread calling this code.- Parameters:
- request-
- Throws:
- RequestProcessor.RequestProcessorException
 
 - 
fixupACLpublic static List<ACL> fixupACL(String path, List<Id> authInfo, 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
 
 - 
processRequestpublic void processRequest(Request request) - Specified by:
- processRequestin interface- RequestProcessor
 
 - 
shutdownpublic void shutdown() - Specified by:
- shutdownin interface- RequestProcessor
 
 
- 
 
-