public static FunctionExecutionException create(Function function, Throwable cause) { List<String> cqlTypes = AbstractType.asCQLTypeStringList(function.argTypes()); FunctionExecutionException fee = new FunctionExecutionException(function.name(), cqlTypes, cause.toString()); fee.initCause(cause); return fee; }
public ByteBuffer execute(ProtocolVersion protocolVersion, List<ByteBuffer> parameters) { assert parameters.size() == 1 : "Unexpectedly got " + parameters.size() + " arguments for fromJson()"; ByteBuffer argument = parameters.get(0); if (argument == null) return null; String jsonArg = UTF8Type.instance.getSerializer().deserialize(argument); try { Object object = Json.JSON_OBJECT_MAPPER.readValue(jsonArg, Object.class); if (object == null) return null; return returnType.fromJSONObject(object).bindAndGet(QueryOptions.forProtocolVersion(protocolVersion)); } catch (IOException exc) { throw new FunctionExecutionException(NAME, Collections.singletonList("text"), String.format("Could not decode JSON string '%s': %s", jsonArg, exc.toString())); } catch (MarshalException exc) { throw FunctionExecutionException.create(this, exc); } } }
DatabaseDescriptor.getUserFunctionTimeoutPolicy() == Config.UserFunctionTimeoutPolicy.ignore ? "" : " - will stop Cassandra VM")); FunctionExecutionException fe = FunctionExecutionException.create(this, cause); JVMStabilityInspector.userFunctionTimeout(cause); throw fe;
DatabaseDescriptor.getUserFunctionTimeoutPolicy() == Config.UserFunctionTimeoutPolicy.ignore ? "" : " - will stop Cassandra VM")); FunctionExecutionException fe = FunctionExecutionException.create(this, cause); JVMStabilityInspector.userFunctionTimeout(cause); throw fe;
public static FunctionExecutionException create(Function function, Throwable cause) { List<String> cqlTypes = AbstractType.asCQLTypeStringList(function.argTypes()); FunctionExecutionException fee = new FunctionExecutionException(function.name(), cqlTypes, cause.toString()); fee.initCause(cause); return fee; }
public ByteBuffer execute(ProtocolVersion protocolVersion, List<ByteBuffer> parameters) { assert parameters.size() == 1 : "Unexpectedly got " + parameters.size() + " arguments for fromJson()"; ByteBuffer argument = parameters.get(0); if (argument == null) return null; String jsonArg = UTF8Type.instance.getSerializer().deserialize(argument); try { Object object = Json.JSON_OBJECT_MAPPER.readValue(jsonArg, Object.class); if (object == null) return null; return returnType.fromJSONObject(object).bindAndGet(QueryOptions.forProtocolVersion(protocolVersion)); } catch (IOException exc) { throw new FunctionExecutionException(NAME, Collections.singletonList("text"), String.format("Could not decode JSON string '%s': %s", jsonArg, exc.toString())); } catch (MarshalException exc) { throw FunctionExecutionException.create(this, exc); } } }
DatabaseDescriptor.getUserFunctionTimeoutPolicy() == Config.UserFunctionTimeoutPolicy.ignore ? "" : " - will stop Cassandra VM")); FunctionExecutionException fe = FunctionExecutionException.create(this, cause); JVMStabilityInspector.userFunctionTimeout(cause); throw fe;
public static FunctionExecutionException create(Function function, Throwable cause) { List<String> cqlTypes = AbstractType.asCQLTypeStringList(function.argTypes()); FunctionExecutionException fee = new FunctionExecutionException(function.name(), cqlTypes, cause.toString()); fee.initCause(cause); return fee; }
public ByteBuffer execute(ProtocolVersion protocolVersion, List<ByteBuffer> parameters) { assert parameters.size() == 1 : "Unexpectedly got " + parameters.size() + " arguments for fromJson()"; ByteBuffer argument = parameters.get(0); if (argument == null) return null; String jsonArg = UTF8Type.instance.getSerializer().deserialize(argument); try { Object object = Json.JSON_OBJECT_MAPPER.readValue(jsonArg, Object.class); if (object == null) return null; return returnType.fromJSONObject(object).bindAndGet(QueryOptions.forProtocolVersion(protocolVersion)); } catch (IOException exc) { throw new FunctionExecutionException(NAME, Collections.singletonList("text"), String.format("Could not decode JSON string '%s': %s", jsonArg, exc.toString())); } catch (MarshalException exc) { throw FunctionExecutionException.create(this, exc); } } }
public final ByteBuffer execute(ProtocolVersion protocolVersion, List<ByteBuffer> parameters) { assertUdfsEnabled(language); if (!isCallableWrtNullable(parameters)) return null; long tStart = System.nanoTime(); parameters = makeEmptyParametersNull(parameters); try { // Using async UDF execution is expensive (adds about 100us overhead per invocation on a Core-i7 MBPr). ByteBuffer result = DatabaseDescriptor.enableUserDefinedFunctionsThreads() ? executeAsync(protocolVersion, parameters) : executeUserDefined(protocolVersion, parameters); Tracing.trace("Executed UDF {} in {}\u03bcs", name(), (System.nanoTime() - tStart) / 1000); return result; } catch (InvalidRequestException e) { throw e; } catch (Throwable t) { logger.trace("Invocation of user-defined function '{}' failed", this, t); if (t instanceof VirtualMachineError) throw (VirtualMachineError) t; throw FunctionExecutionException.create(this, t); } }
public static FunctionExecutionException create(Function function, Throwable cause) { List<String> cqlTypes = AbstractType.asCQLTypeStringList(function.argTypes()); FunctionExecutionException fee = new FunctionExecutionException(function.name(), cqlTypes, cause.toString()); fee.initCause(cause); return fee; }
public ByteBuffer execute(ProtocolVersion protocolVersion, List<ByteBuffer> parameters) { assert parameters.size() == 1 : "Unexpectedly got " + parameters.size() + " arguments for fromJson()"; ByteBuffer argument = parameters.get(0); if (argument == null) return null; String jsonArg = UTF8Type.instance.getSerializer().deserialize(argument); try { Object object = Json.JSON_OBJECT_MAPPER.readValue(jsonArg, Object.class); if (object == null) return null; return returnType.fromJSONObject(object).bindAndGet(QueryOptions.forProtocolVersion(protocolVersion)); } catch (IOException exc) { throw new FunctionExecutionException(NAME, Collections.singletonList("text"), String.format("Could not decode JSON string '%s': %s", jsonArg, exc.toString())); } catch (MarshalException exc) { throw FunctionExecutionException.create(this, exc); } } }
public final ByteBuffer execute(ProtocolVersion protocolVersion, List<ByteBuffer> parameters) { assertUdfsEnabled(language); if (!isCallableWrtNullable(parameters)) return null; long tStart = System.nanoTime(); parameters = makeEmptyParametersNull(parameters); try { // Using async UDF execution is expensive (adds about 100us overhead per invocation on a Core-i7 MBPr). ByteBuffer result = DatabaseDescriptor.enableUserDefinedFunctionsThreads() ? executeAsync(protocolVersion, parameters) : executeUserDefined(protocolVersion, parameters); Tracing.trace("Executed UDF {} in {}\u03bcs", name(), (System.nanoTime() - tStart) / 1000); return result; } catch (InvalidRequestException e) { throw e; } catch (Throwable t) { logger.trace("Invocation of user-defined function '{}' failed", this, t); if (t instanceof VirtualMachineError) throw (VirtualMachineError) t; throw FunctionExecutionException.create(this, t); } }
public final ByteBuffer execute(ProtocolVersion protocolVersion, List<ByteBuffer> parameters) { assertUdfsEnabled(language); if (!isCallableWrtNullable(parameters)) return null; long tStart = System.nanoTime(); parameters = makeEmptyParametersNull(parameters); try { // Using async UDF execution is expensive (adds about 100us overhead per invocation on a Core-i7 MBPr). ByteBuffer result = DatabaseDescriptor.enableUserDefinedFunctionsThreads() ? executeAsync(protocolVersion, parameters) : executeUserDefined(protocolVersion, parameters); Tracing.trace("Executed UDF {} in {}\u03bcs", name(), (System.nanoTime() - tStart) / 1000); return result; } catch (InvalidRequestException e) { throw e; } catch (Throwable t) { logger.trace("Invocation of user-defined function '{}' failed", this, t); if (t instanceof VirtualMachineError) throw (VirtualMachineError) t; throw FunctionExecutionException.create(this, t); } }
if (t instanceof VirtualMachineError) throw (VirtualMachineError) t; throw FunctionExecutionException.create(this, t);
if (t instanceof VirtualMachineError) throw (VirtualMachineError) t; throw FunctionExecutionException.create(this, t);
if (t instanceof VirtualMachineError) throw (VirtualMachineError) t; throw FunctionExecutionException.create(this, t);