如何将数据从 Hadoop Avro 源加载到 ActivePivot 存储中?
问问题
148 次
2 回答
0
查看您应该有权访问的 ActivePivot Sandbox 项目,并查看通道用于将数据持久保存到数据存储的位置。
于 2017-07-31T21:46:52.393 回答
0
假设您有应该发布到多维数据集的课程。
public class PostVectorFact {
private final LocalDate date;
//other fields
//getters, equals, hashCode
}
在您的 spring 配置中,您需要定义消息 chanell
@Autowired
protected IDatastore datastore;
@Autowired
protected KeepArbitraryEpochPolicy epochPolicy;
@Autowired
protected LocationHelper locationHelper;
public IMessageChannel<String, Object> returnsRealTimeChannel() {
return pojoMessageChannelFactory().createChannel("RealTimeReturns", DataStoreConstants.RETURNS_STORE, tuplePublisher());
}
@Bean
ITuplePublisher<String> tuplePublisher() {
return new VersionCheckingTuplePublisher(datastore, DataStoreConstants.RETURNS_STORE, DataStoreConstants.LATEST_RETURNS_STORE, 2L, epochPolicy, locationHelper);
}
@Bean
public CubeReturnsFactPublisher cubeReturnsFactPublisher() {
return new CubeReturnsFactPublisher(returnsRealTimeChannel());
}
以及发布者类本身:
public class CubeReturnsFactPublisher {
IMessageChannel<String, Object> messageChannel;
public CubeReturnsFactPublisher(IMessageChannel<String, Object> messageChannel) {
super();
this.messageChannel = messageChannel;
}
public void publish(List<ReturnVectorFact> facts) {
messageChannel.sendMessage("", facts);
}
}
发布数据的方式:
cubeReturnsFactPublisher.publish(Collections.singletonList(new PostVectorFact(...)));
于 2018-05-16T10:13:09.620 回答