Search in sources :

Example 1 with NullPhoenixSink

use of org.apache.phoenix.flume.sink.NullPhoenixSink in project phoenix by apache.

the class PhoenixSinkIT method testExtendedSink.

@Test
public void testExtendedSink() throws Exception {
    // Create a mock NullPhoenixSink which extends PhoenixSink, and verify configure is invoked()
    PhoenixSink sink = mock(NullPhoenixSink.class);
    sinkContext = new Context();
    sinkContext.put(FlumeConstants.CONFIG_TABLE, "FLUME_TEST_EXTENDED");
    sinkContext.put(FlumeConstants.CONFIG_JDBC_URL, getUrl());
    sinkContext.put(FlumeConstants.CONFIG_SERIALIZER, CustomSerializer.class.getName());
    sinkContext.put(FlumeConstants.CONFIG_SERIALIZER_PREFIX + FlumeConstants.CONFIG_COLUMN_NAMES, "ID, COUNTS");
    sinkContext.put(FlumeConstants.CONFIG_SERIALIZER_PREFIX + FlumeConstants.CONFIG_ROWKEY_TYPE_GENERATOR, DefaultKeyGenerator.TIMESTAMP.name());
    Configurables.configure(sink, sinkContext);
    verify(sink).configure(sinkContext);
}
Also used : Context(org.apache.flume.Context) CustomSerializer(org.apache.phoenix.flume.serializer.CustomSerializer) NullPhoenixSink(org.apache.phoenix.flume.sink.NullPhoenixSink) PhoenixSink(org.apache.phoenix.flume.sink.PhoenixSink) Test(org.junit.Test)

Aggregations

Context (org.apache.flume.Context)1 CustomSerializer (org.apache.phoenix.flume.serializer.CustomSerializer)1 NullPhoenixSink (org.apache.phoenix.flume.sink.NullPhoenixSink)1 PhoenixSink (org.apache.phoenix.flume.sink.PhoenixSink)1 Test (org.junit.Test)1