Search in sources :

Example 26 with ParameterSet

use of org.voltdb.ParameterSet in project voltdb by VoltDB.

the class RandomMsgGenerator method makeIv2InitiateTaskMsg.

private Iv2InitiateTaskMessage makeIv2InitiateTaskMsg(boolean readOnly, boolean binaryLog, boolean isMp) {
    StoredProcedureInvocation spi = mock(StoredProcedureInvocation.class);
    ParameterSet ps = mock(ParameterSet.class);
    when(spi.getParams()).thenReturn(ps);
    if (binaryLog) {
        when(ps.toArray()).thenReturn(new Object[] { null, 0l, 0l, Long.MIN_VALUE, Long.MIN_VALUE, null });
        if (!isMp) {
            when(spi.getProcName()).thenReturn("@ApplyBinaryLogSP");
        } else {
            when(spi.getProcName()).thenReturn("@ApplyBinaryLogMP");
        }
    } else {
        when(ps.toArray()).thenReturn(new Object[] { null, 0l, 0l, Long.MIN_VALUE, null });
        when(spi.getProcName()).thenReturn("dummy");
    }
    Iv2InitiateTaskMessage msg = new Iv2InitiateTaskMessage(0l, 0l, 0l, Long.MIN_VALUE, 0l, readOnly, !isMp, spi, 0l, 0l, false);
    return msg;
}
Also used : ParameterSet(org.voltdb.ParameterSet) StoredProcedureInvocation(org.voltdb.StoredProcedureInvocation) Iv2InitiateTaskMessage(org.voltdb.messaging.Iv2InitiateTaskMessage)

Example 27 with ParameterSet

use of org.voltdb.ParameterSet in project voltdb by VoltDB.

the class HTTPUtils method callProcedure.

public static Response callProcedure(String string, String key, byte[] storeValue, CloseableHttpClient httpclient, HttpPost httppost) throws JSONException, IOException, Exception {
    String hexval = Encoder.hexEncode(storeValue);
    ParameterSet pset = ParameterSet.fromArrayNoCopy(key, hexval);
    String resp = callProcOverJSON(string, pset, username, password, prehash, httpclient, httppost);
    Response response = responseFromJSON(resp);
    return response;
}
Also used : ParameterSet(org.voltdb.ParameterSet) CloseableHttpResponse(org.apache.http.client.methods.CloseableHttpResponse)

Example 28 with ParameterSet

use of org.voltdb.ParameterSet in project voltdb by VoltDB.

the class HTTPUtils method callProcedure.

public static Response callProcedure(String string, String generateRandomKeyForRetrieval, CloseableHttpClient httpclient, HttpPost httppost) throws JSONException, IOException, Exception {
    ParameterSet pset = ParameterSet.fromArrayNoCopy(generateRandomKeyForRetrieval);
    String resp = callProcOverJSON(string, pset, username, password, prehash, httpclient, httppost);
    Response response = responseFromJSON(resp);
    return response;
}
Also used : ParameterSet(org.voltdb.ParameterSet) CloseableHttpResponse(org.apache.http.client.methods.CloseableHttpResponse)

Aggregations

ParameterSet (org.voltdb.ParameterSet)28 IOException (java.io.IOException)9 ByteBuffer (java.nio.ByteBuffer)9 EEException (org.voltdb.exceptions.EEException)5 PlanFragment (org.voltdb.catalog.PlanFragment)3 Statement (org.voltdb.catalog.Statement)3 SerializableException (org.voltdb.exceptions.SerializableException)3 FastDeserializer (org.voltdb.messaging.FastDeserializer)3 Iv2InitiateTaskMessage (org.voltdb.messaging.Iv2InitiateTaskMessage)3 EOFException (java.io.EOFException)2 UnsupportedEncodingException (java.io.UnsupportedEncodingException)2 CloseableHttpResponse (org.apache.http.client.methods.CloseableHttpResponse)2 DependencyPair (org.voltdb.DependencyPair)2 StoredProcedureInvocation (org.voltdb.StoredProcedureInvocation)2 VoltTable (org.voltdb.VoltTable)2 SQLException (org.voltdb.exceptions.SQLException)2 FragmentResponseMessage (org.voltdb.messaging.FragmentResponseMessage)2 CorePlan (org.voltdb.planner.CorePlan)2 ArrayList (java.util.ArrayList)1 Random (java.util.Random)1