Package org.springframework.data.hadoop.store.dataset

Examples of org.springframework.data.hadoop.store.dataset.DatasetOperations


    t2.setId(2);
    t2.setTimestamp(System.currentTimeMillis());
    t2.setDescription("x"); //TODO: this is temporary, due to changes in Kite SDK 0.17.0
    channel.send(MessageBuilder.withPayload(Collections.singletonList(t2)).build());

    DatasetOperations datasetOperations = context.getBean("datasetOperations", DatasetOperations.class);
    String path = context.getBean("path", String.class);
    assertTrue("Dataset path created", new File(path).exists());
    assertTrue("Dataset storage created",
        new File(path + "/" + "test/" + datasetOperations.getDatasetName(TestPojo.class)).exists());
    assertTrue("Dataset metadata created",
        new File(path + "/" + "test/" + datasetOperations.getDatasetName(TestPojo.class) + "/.metadata").exists());
    String year = new SimpleDateFormat("YYYY").format(t1.getTimestamp());
    assertTrue("Dataset partition path created",
        new File(path + "/" + "test/" + datasetOperations.getDatasetName(TestPojo.class) + "/year=" + year).exists());
    context.close();
  }
View Full Code Here


    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
        "org/springframework/xd/integration/hadoop/config/DatasetOutboundChannelAdapterIntegrationTests.xml");
    MessageChannel channel = context.getBean("datasetOut", MessageChannel.class);
    channel.send(MessageBuilder.withPayload("foo").build());
    channel.send(MessageBuilder.withPayload("bar").build());
    DatasetOperations datasetOperations = context.getBean("datasetOperations", DatasetOperations.class);
    String path = context.getBean("path", String.class);
    assertTrue("Dataset path created", new File(path).exists());
    assertTrue("Dataset storage created",
        new File(path + "/" + "test/" + datasetOperations.getDatasetName(String.class)).exists());
    assertTrue("Dataset metadata created",
        new File(path + "/" + "test/" + datasetOperations.getDatasetName(String.class) + "/.metadata").exists());
    context.close();
  }
View Full Code Here

    EventDrivenConsumer adapter = context.getBean("adapter", EventDrivenConsumer.class);
    HdfsWritingMessageHandler handler = (HdfsWritingMessageHandler) new DirectFieldAccessor(adapter).getPropertyValue("handler");
    DirectFieldAccessor handlerAccessor = new DirectFieldAccessor(handler);
    assertEquals(false, handlerAccessor.getPropertyValue("autoStartup"));
    DatasetWriterFactory writerFactory = (DatasetWriterFactory) handlerAccessor.getPropertyValue("hdfsWriterFactory");
    DatasetOperations datasetOperations = (DatasetOperations) new DirectFieldAccessor(writerFactory).getPropertyValue("datasetOperations");
    assertEquals(context.getBean("datasetOperations"), datasetOperations);
    context.close();
  }
View Full Code Here

TOP

Related Classes of org.springframework.data.hadoop.store.dataset.DatasetOperations

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.