Package org.jredis

Examples of org.jredis.ClientRuntimeException


        Response response = null;
        try {
                  response = JRedisPipeline.this.queueRequest(cmd, args).get(timeout, unit);
                }
                catch (InterruptedException e) {
                  throw new ClientRuntimeException("Interrupted!", e);
                }
                catch (TimeoutException e) {
                  throw new ClientRuntimeException("timedout waiting for response");
                }
                catch (ExecutionException e) {
                  Throwable cause = e.getCause();
                  if(cause instanceof RedisException)
                    throw (RedisException) cause;
                  else if(cause instanceof ProviderException)
                    throw (ProviderException) cause;
                  else if(cause instanceof ClientRuntimeException)
                    throw (ClientRuntimeException)cause;
                  else throw new ClientRuntimeException("Exception in pipeline exec of requested command", cause);
                }
                return response;
            }
    };
  }
View Full Code Here


          // This will block.
          response = pendingResponse.get();
        }
        catch (InterruptedException e) {
          e.printStackTrace();
          throw new ClientRuntimeException("on pendingResponse.get()", e);
        }
        catch (ExecutionException e) {
          if(e.getCause() instanceof RedisException) {
            throw (RedisException) e.getCause();
          }
View Full Code Here

        // on connection reset
        throw new ConnectionReset("SocketException in readLine.  Command: " + cmd.code, e);
      }
      catch (IOException e) {
        e.printStackTrace();
        throw new ClientRuntimeException ("IOException in readLine.  Command: " + cmd.code, e);
      }
    }
View Full Code Here

      InetAddress address;
        try {
          address = InetAddress.getByName(host);
        }
        catch (UnknownHostException e) {
          throw new ClientRuntimeException("unknown host: " + host, e);
        }
   
    return newSpec(address, port, database, credentials);
  }
View Full Code Here

          }
        }
      }
      catch (IOException e) {
        e.printStackTrace();
        throw new ClientRuntimeException ("IOEx while reading line for command " + cmd.code, e);
      }
     
      if(c==-1) throw new ClientRuntimeException ("in.read returned -1");
    }
View Full Code Here

     
      int readcnt = -1;
      int offset = 0;

      while(offset < length){
        if((readcnt = in.read (data, offset, length-offset)) ==-1 ) throw new ClientRuntimeException("IO - read returned -1 -- problem");
        offset += readcnt;
      }
      // FIX: http://github.com/alphazero/jredis/issues#issue/5 -- BEGIN
      for(int i=0; i<CRLF_LEN; i++){
        if (in.read() == -1){
View Full Code Here

    return this;
  }
 
  public Sort LIMIT(long from, long count) {
    if(from < 0) {
      throw new ClientRuntimeException("from in LIMIT clause: " + from);
    }
   
    if(count <= 0) {
      throw new ClientRuntimeException("count in LIMIT clause: " + from);
    }
   
//    String limitSpecName = Command.Option.LIMIT.name();
      String fromString = new Long(from).toString();
      String countString = new Long(count).toString();
View Full Code Here

      Log.bug ("serviceRequest() -- *unexpected* RuntimeException: " + e.getLocalizedMessage());

      Log.log ("serviceRequest() -- closing connection ...");
      disconnect();

      throw new ClientRuntimeException("unexpected runtime exeption: " + e.getLocalizedMessage(), e);
    }
    // 3 - Status
    //
    status = Assert.notNull (response.getStatus(), "status from response object", ProviderException.class);
    if(status.isError()) {
View Full Code Here

      Log.bug ("serviceRequest() -- *unexpected* RuntimeException: " + e.getLocalizedMessage());

      Log.log ("serviceRequest() -- closing connection ...");
      disconnect();

      throw new ClientRuntimeException("unexpected runtime exeption: " + e.getLocalizedMessage(), e);
    }
   
    // 3 - Status
    //
    status = Assert.notNull (response.getStatus(), "status from response object", ProviderException.class);
View Full Code Here

        }
        catch (IllegalArgumentException bug){
          throw new ProviderException ("Bug: in converting the bulk data length bytes", bug);
        }
        catch (IOException problem) {
          throw new ClientRuntimeException ("Problem: reading the bulk data bytes", problem);
        }
        catch (RuntimeException bug) {
          throw new ProviderException ("Bug: reading the bulk data bytes.  expecting " + size + " bytes.", bug);
        }
      }
View Full Code Here

TOP

Related Classes of org.jredis.ClientRuntimeException

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.