@ Override protected void registerRequest ( RestRequestValidator requestValidator , ChannelHandlerContext ctx , MessageEvent messageEvent ) { // At this point we know the request is valid and we have a // error handler. So we construct the composite Voldemort // request object. CompositeVoldemortRequest < ByteArray , byte [ ] > requestObject = requestValidator . constructCompositeVoldemortRequestObject ( ) ; if ( requestObject != null ) { DynamicTimeoutStoreClient < ByteArray , byte [ ] > storeClient = null ; if ( ! requestValidator . getStoreName ( ) . equalsIgnoreCase ( RestMessageHeaders . SCHEMATA_STORE ) ) { storeClient = this . fatClientMap . get ( requestValidator . getStoreName ( ) ) ; if ( storeClient == null ) { logger . error ( "Error when getting store. Non Existing store client." ) ; RestErrorHandler . writeErrorResponse ( messageEvent , HttpResponseStatus . BAD_REQUEST , "Non Existing store client. Critical error." ) ; return ; } } else { requestObject . setOperationType ( VoldemortOpCode . GET_METADATA_OP_CODE ) ; } CoordinatorStoreClientRequest coordinatorRequest = new CoordinatorStoreClientRequest ( requestObject , storeClient ) ; Channels . fireMessageReceived ( ctx , coordinatorRequest ) ; } }
Constructs a valid request and passes it on to the next handler . It also creates the StoreClient object corresponding to the store name specified in the REST request .