@Override public Response serviceRequest(Command cmd, byte[]... args) throws RedisException, ClientRuntimeException, ProviderException { throw new ClientRuntimeException (errorMsg); }
public Response serviceRequest(Command cmd, byte[]... args) throws RedisException, ClientRuntimeException, ProviderException { throw new ClientRuntimeException (errorMsg); }
@Override public Future<Response> queueRequest(Command cmd, byte[]... args) throws ClientRuntimeException, ProviderException { throw new ClientRuntimeException (errorMsg); } /* (non-Javadoc) @see org.jredis.connector.Connection#addListener(org.jredis.connector.Connection.Listener) */
@Override public Response serviceRequest(Command cmd, byte[]... args) throws RedisException, ClientRuntimeException, ProviderException { throw new ClientRuntimeException (errorMsg); }
@Override public Future<Response> queueRequest(Command cmd, byte[]... args) throws ClientRuntimeException, ProviderException { throw new ClientRuntimeException (errorMsg); } /* (non-Javadoc) @see org.jredis.connector.Connection#addListener(org.jredis.connector.Connection.Listener) */
public Future<Response> queueRequest(Command cmd, byte[]... args) throws ClientRuntimeException, ProviderException { throw new ClientRuntimeException (errorMsg); } /* (non-Javadoc) @see org.jredis.connector.Connection#addListener(org.jredis.connector.Connection.Listener) */
public Modality getModality() { throw new ClientRuntimeException (errorMsg); }
public static long unpackValue (List<byte[]> queryResult){ if(null == queryResult) throw new ClientRuntimeException("queryResult is null"); if(queryResult.size() < 1) throw new ClientRuntimeException("queryResult must have at least 1 entry"); return Long.parseLong(new String(queryResult.get(0))); } }
public static long unpackValue (List<byte[]> queryResult){ if(null == queryResult) throw new ClientRuntimeException("queryResult is null"); if(queryResult.size() < 1) throw new ClientRuntimeException("queryResult must have at least 1 entry"); return Long.parseLong(new String(queryResult.get(0))); } }
public static long unpackValue (List<byte[]> queryResult){ if(null == queryResult) throw new ClientRuntimeException("queryResult is null"); if(queryResult.size() < 1) throw new ClientRuntimeException("queryResult must have at least 1 entry"); return Long.parseLong(new String(queryResult.get(0))); } }
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); limitSpec = String.format("%s %d %d%s", Command.Option.LIMIT.name(), from, count, PAD); return this; } /** Store the sort results in another key */
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(); limitSpec.add(Command.Option.LIMIT.bytes); limitSpec.add(fromString.getBytes()); limitSpec.add(countString.getBytes()); 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(); limitSpec.add(Command.Option.LIMIT.bytes); limitSpec.add(fromString.getBytes()); limitSpec.add(countString.getBytes()); return this; }
@Override protected Response serviceRequest (Command cmd, byte[]... args) throws RedisException, ClientRuntimeException, ProviderException { Response response = null; try { response = JRedisPipeline.this.queueRequest(cmd, args).get(); } catch (InterruptedException e) { throw new ClientRuntimeException("Interrupted!", e); } 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; } };
@Override protected Response serviceRequest (Command cmd, byte[]... args) throws RedisException, ClientRuntimeException, ProviderException { Response response = null; try { response = JRedisPipeline.this.queueRequest(cmd, args).get(); } catch (InterruptedException e) { throw new ClientRuntimeException("Interrupted!", e); } 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; } };
/** * Will throw a {@link ClientRuntimeException} if raiseEx is true * @throws IllegalStateException */ protected final void onConnectionFault (String fault, boolean raiseEx) throws ClientRuntimeException { notifyFaulted(fault); Log.problem("Conn FAULT: %s - %s", fault, this); if(raiseEx) throw new ClientRuntimeException(fault); }
/** * Will throw a {@link ClientRuntimeException} if raiseEx is true * @throws IllegalStateException */ protected final void onConnectionFault (String fault, boolean raiseEx) throws ClientRuntimeException { notifyFaulted(fault); Log.problem("Shutting down due to connection FAULT: %s - %s", fault, this); // notifyShuttingDown(); shutdown(); // REVU: best to add a pending shutdown flag .. if(raiseEx) throw new ClientRuntimeException(fault); }
/** * Will throw a {@link ClientRuntimeException} if raiseEx is true * @throws IllegalStateException */ protected final void onConnectionFault (String fault, boolean raiseEx) throws ClientRuntimeException { notifyFaulted(fault); Log.problem("Shutting down due to connection FAULT: %s - %s", fault, this); // notifyShuttingDown(); shutdown(); // REVU: best to add a pending shutdown flag .. if(raiseEx) throw new ClientRuntimeException(fault); }
public void read(InputStream in) throws ClientRuntimeException, ProviderException { if(didRead) return; // BufferedInputStream bin = new BufferedInputStream(in, INPUT_STREAM_BUFFER_SIZE); int size = readControlLine (in, true, SIZE_BYTE); if(!status.isError() && size >= 0){ try { data = super.readBulkData(in, size); } 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); } } didRead = true; return; } }
@Override public void read(InputStream in) throws ClientRuntimeException, ProviderException { if(didRead) return; // BufferedInputStream bin = new BufferedInputStream(in, INPUT_STREAM_BUFFER_SIZE); int size = readControlLine (in, true, SIZE_BYTE); if(!status.isError() && size >= 0){ try { data = super.readBulkData(in, size); } 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); } } didRead = true; return; } }