Search in sources :

Example 6 with FragmentWritableBatch

use of org.apache.drill.exec.record.FragmentWritableBatch in project drill by apache.

the class TestBitBitKerberos method successEncryption.

@Test
public void successEncryption(@Injectable WorkerBee bee, @Injectable final WorkEventBus workBus) throws Exception {
    newConfig = new DrillConfig(config.withValue(ExecConstants.AUTHENTICATION_MECHANISMS, ConfigValueFactory.fromIterable(Lists.newArrayList("kerberos"))).withValue(ExecConstants.BIT_AUTHENTICATION_ENABLED, ConfigValueFactory.fromAnyRef(true)).withValue(ExecConstants.BIT_AUTHENTICATION_MECHANISM, ConfigValueFactory.fromAnyRef("kerberos")).withValue(ExecConstants.BIT_ENCRYPTION_SASL_ENABLED, ConfigValueFactory.fromAnyRef(true)).withValue(ExecConstants.USE_LOGIN_PRINCIPAL, ConfigValueFactory.fromAnyRef(true)).withValue(BootStrapContext.SERVICE_PRINCIPAL, ConfigValueFactory.fromAnyRef(krbHelper.SERVER_PRINCIPAL)).withValue(BootStrapContext.SERVICE_KEYTAB_LOCATION, ConfigValueFactory.fromAnyRef(krbHelper.serverKeytab.toString())), false);
    updateTestCluster(1, newConfig);
    new NonStrictExpectations() {

        {
            workBus.getFragmentManagerIfExists((FragmentHandle) any);
            result = manager;
            workBus.getFragmentManager((FragmentHandle) any);
            result = manager;
        }
    };
    DataConnectionConfig config = new DataConnectionConfig(c1.getAllocator(), c1, new DataServerRequestHandler(workBus, bee));
    DataServer server = new DataServer(config);
    port = server.bind(port, true);
    DrillbitEndpoint ep = DrillbitEndpoint.newBuilder().setAddress("localhost").setDataPort(port).build();
    DataConnectionManager connectionManager = new DataConnectionManager(ep, config);
    DataTunnel tunnel = new DataTunnel(connectionManager);
    AtomicLong max = new AtomicLong(0);
    for (int i = 0; i < 40; i++) {
        long t1 = System.currentTimeMillis();
        tunnel.sendRecordBatch(new TimingOutcome(max), new FragmentWritableBatch(false, QueryId.getDefaultInstance(), 1, 1, 1, 1, getRandomBatch(c1.getAllocator(), 5000)));
        System.out.println(System.currentTimeMillis() - t1);
    }
    System.out.println(String.format("Max time: %d", max.get()));
    assertTrue(max.get() > 2700);
    Thread.sleep(5000);
}
Also used : FragmentWritableBatch(org.apache.drill.exec.record.FragmentWritableBatch) DrillbitEndpoint(org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint) AtomicLong(java.util.concurrent.atomic.AtomicLong) DrillbitEndpoint(org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint) DrillConfig(org.apache.drill.common.config.DrillConfig) NonStrictExpectations(mockit.NonStrictExpectations) Test(org.junit.Test)

Aggregations

FragmentWritableBatch (org.apache.drill.exec.record.FragmentWritableBatch)6 DrillbitEndpoint (org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint)5 AtomicLong (java.util.concurrent.atomic.AtomicLong)4 NonStrictExpectations (mockit.NonStrictExpectations)4 Test (org.junit.Test)4 DrillConfig (org.apache.drill.common.config.DrillConfig)3 MinorFragmentEndpoint (org.apache.drill.exec.physical.MinorFragmentEndpoint)2 IOException (java.io.IOException)1 Mock (mockit.Mock)1 ExecTest (org.apache.drill.exec.ExecTest)1 FragmentSetupException (org.apache.drill.exec.exception.FragmentSetupException)1 OutOfMemoryException (org.apache.drill.exec.exception.OutOfMemoryException)1 BufferAllocator (org.apache.drill.exec.memory.BufferAllocator)1 AccountingDataTunnel (org.apache.drill.exec.ops.AccountingDataTunnel)1 FragmentContext (org.apache.drill.exec.ops.FragmentContext)1 FragmentHandle (org.apache.drill.exec.proto.ExecProtos.FragmentHandle)1 BatchSchema (org.apache.drill.exec.record.BatchSchema)1 RawFragmentBatch (org.apache.drill.exec.record.RawFragmentBatch)1 RecordBatch (org.apache.drill.exec.record.RecordBatch)1 WritableBatch (org.apache.drill.exec.record.WritableBatch)1