Package org.jredis.protocol

Examples of org.jredis.protocol.ResponseStatus


          while(cnt < reqCnt){
            futureStat = pipeline.set(key, data);
            cnt++;
          }
          assert futureStat != null;
          @SuppressWarnings({ "null", "unused" })
        ResponseStatus rstat = futureStat.get();
          long respDoneTime = timer.mark();
        if(iters > 0){
          totTime += respDoneTime;
          avgRespTime = (totTime) / iters;
View Full Code Here


       * So we have a Future<?> object, but is that the actual response?  No.  You need to wait
       * for it to actually complete.
       *
       * Here we're waiting using blocking semantics:  we wait until its done.
       */
          ResponseStatus response = fResp.get();
         
          /**
           * So we have our response at this point.  We can check it, etc.
           */
          if(response.isError()){
            Log.error("PING returned an ERR response -- is it an authorization issue?");
          }
        }
        catch (InterruptedException e) {
          /*
 
View Full Code Here

        if(c == -1) {
          Log.error("-1 read count in readLine() while reading response line.");
          throw new UnexpectedEOFException ("Unexpected EOF (read -1) in readLine.  Command: " + cmd.code);
        }
        if((this.isError = buffer[0] == ProtocolBase.ERR_BYTE) == true)
          status = new ResponseStatus(ResponseStatus.Code.ERROR, new String(buffer, 1, offset-3));
        else
          status = ResponseStatus.STATUS_OK;
      }
      catch (SocketException e) {
        // on connection reset
View Full Code Here

        if(c == -1) {
          Log.error("-1 read count in readLine() while reading response line.");
          throw new UnexpectedEOFException ("Unexpected EOF (read -1) in readLine.  Command: " + cmd.code);
        }
        if((this.isError = buffer[0] == ProtocolBase.ERR_BYTE) == true)
          status = new ResponseStatus(ResponseStatus.Code.ERROR, new String(buffer, 1, offset-3));
        else
          status = ResponseStatus.STATUS_OK;
      }
      catch (SocketException e) {
        // on connection reset
View Full Code Here

     * @return
     */
    int readControlLine (InputStream in, boolean checkForError, byte ctlByte){
      seekToCRLF(in);
      if(checkForError && (this.isError = buffer[0] == ProtocolBase.ERR_BYTE) == true) {
        status = new ResponseStatus(ResponseStatus.Code.ERROR, new String(buffer, 1, offset-3));
        didRead = true// we're done - error's are only one line
        return -2;
      }
      if(buffer[0] != ctlByte) {
        throw new ProviderException ("Bug?  Expecting status code for size/count");
View Full Code Here

          }
        }
     
        // check response status
        //
    ResponseStatus status = Assert.notNull (response.getStatus(), "status from response object", ProviderException.class);
    if(status.isError()) {
      Log.error ("Error response for " + cmd.code + " => " + status.message());
      throw new RedisException(cmd, status.message());
    }
    /* this is handled by the super class */
//    else if(status.code() == ResponseStatus.Code.CIAO) {
//      // normal for quit and shutdown commands.  we disconnect too.
//      disconnect();
View Full Code Here

TOP

Related Classes of org.jredis.protocol.ResponseStatus

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.