avro.shaded.com.google.common.collect.Maps Java Examples
The following examples show how to use
avro.shaded.com.google.common.collect.Maps.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DispatcherCmdHandlerProvider.java From DBus with Apache License 2.0 | 5 votes |
@Override public Map<Command, BoltCommandHandler> provideHandlers(DbusDatasourceType type) { Map<Command, BoltCommandHandler> map = Maps.newHashMap(); map.put(Command.APPENDER_RELOAD_CONFIG, new CommonReloadHandler(listener)); map.put(Command.APPENDER_TOPIC_RESUME, new DispatcherResumeHandler(listener)); map.put(Command.FULL_DATA_PULL_REQ, new DispatcherInitialLoadHandler(listener)); return map; }
Example #2
Source File: FileFailureEventReporterTest.java From incubator-gobblin with Apache License 2.0 | 5 votes |
@Test public void testReport() throws IOException { MetricContext testContext = MetricContext.builder(getClass().getCanonicalName()).build(); FileSystem fs = mock(FileSystem.class); Path failureLogPath = mock(Path.class); FSDataOutputStream outputStream = mock(FSDataOutputStream.class); FileFailureEventReporter reporter = new FileFailureEventReporter(testContext, fs, failureLogPath); when(fs.exists(any())).thenReturn(true); when(fs.append(any())).thenReturn(outputStream); final String eventName = "testEvent"; final String eventNamespace = "testNamespace"; GobblinTrackingEvent event = new GobblinTrackingEvent(0L, eventNamespace, eventName, Maps.newHashMap()); // Noop on normal event testContext.submitEvent(event); verify(fs, never()).append(failureLogPath); verify(outputStream, never()).write(anyByte()); // Process failure event FailureEventBuilder failureEvent = new FailureEventBuilder(eventName, eventNamespace); failureEvent.submit(testContext); reporter.report(); // Failure log output is setup verify(fs, times(1)).append(failureLogPath); // Report successfully doAnswer( invocation -> null ).when(outputStream).write(any(byte[].class), anyInt(), anyInt()); verify(outputStream, times(1)).write(any(byte[].class), anyInt(), anyInt()); }
Example #3
Source File: KafkaWriterCmdHandlerProvider.java From DBus with Apache License 2.0 | 5 votes |
@Override public Map<Command, BoltCommandHandler> provideHandlers(DbusDatasourceType type) { Map<Command, BoltCommandHandler> map = Maps.newHashMap(); map.put(Command.APPENDER_RELOAD_CONFIG, new ReloadCommandHandler(listener)); map.put(Command.HEART_BEAT, new HeartbeatHandler(listener, tableStatReporter)); //这个common中的不能适用于mongo,故下面mongo自己的实现 //map.put(Command.HEART_BEAT, new MongoHeartbeatHandler(listener, tableStatReporter)); map.put(Command.DATA_INCREMENT_TERMINATION, new IncrementTerminationHandler(listener)); return map; }
Example #4
Source File: AppenderCmdHandlerProvider.java From DBus with Apache License 2.0 | 5 votes |
@Override public Map<Command, BoltCommandHandler> provideHandlers(DbusDatasourceType type) { Map<Command, BoltCommandHandler> map = Maps.newHashMap(); map.put(Command.APPENDER_RELOAD_CONFIG, new CommonReloadHandler(listener)); map.put(Command.APPENDER_TOPIC_RESUME, new AppenderResumeHandler(listener)); map.put(Command.FULL_DATA_PULL_REQ, new AppenderInitialLoadHandler(listener)); map.put(Command.HEART_BEAT, new AppenderHeartbeatHandler(listener)); map.put(Command.META_SYNC, new MongoMetaSyncEventHandler(listener)); return map; }
Example #5
Source File: WrapperCmdHandlerProvider.java From DBus with Apache License 2.0 | 5 votes |
@Override public Map<Command, BoltCommandHandler> provideHandlers(DbusDatasourceType type) { Map<Command, BoltCommandHandler> map = Maps.newHashMap(); map.put(Command.HEART_BEAT, new CommonHeartbeatHandler(listener)); map.put(Command.APPENDER_RELOAD_CONFIG, new FilteredReloadCommandHandler(listener)); map.put(Command.DATA_INCREMENT_TERMINATION, new CommonTerminationHandler(listener)); /** * 在此处添加新的handler * 目的是处理拉全量之后需要重新从zk中获取UMS_UID * 否则后续的一段时间之内,增量的UMS_UID将比全量的小 */ map.put(Command.APPENDER_TOPIC_RESUME, new WrapperResumeHandler(listener)); return map; }
Example #6
Source File: DispatcherCmdHandlerProvider.java From DBus with Apache License 2.0 | 5 votes |
@Override public Map<Command, BoltCommandHandler> provideHandlers(DbusDatasourceType type) { Map<Command, BoltCommandHandler> map = Maps.newHashMap(); map.put(Command.APPENDER_RELOAD_CONFIG, new CommonReloadHandler(listener)); map.put(Command.APPENDER_TOPIC_RESUME, new DispatcherResumeHandler(listener)); map.put(Command.FULL_DATA_PULL_REQ, new DispatcherInitialLoadHandler(listener)); return map; }
Example #7
Source File: Convertor.java From DBus with Apache License 2.0 | 5 votes |
private static Map<String, Object> convert2map(String document) { Map<String, Object> map = Maps.newHashMap(); if (document != null && !document.isEmpty()) { JSONObject documentJson = JSON.parseObject(document); for (String key : documentJson.keySet()) { map.put(key, documentJson.getString(key)); } } return map; }
Example #8
Source File: KafkaWriterCmdHandlerProvider.java From DBus with Apache License 2.0 | 5 votes |
@Override public Map<Command, BoltCommandHandler> provideHandlers(DbusDatasourceType type) { Map<Command, BoltCommandHandler> map = Maps.newHashMap(); map.put(Command.APPENDER_RELOAD_CONFIG, new ReloadCommandHandler(listener)); map.put(Command.HEART_BEAT, new HeartbeatHandler(listener, tableStatReporter)); map.put(Command.DATA_INCREMENT_TERMINATION, new IncrementTerminationHandler(listener)); return map; }
Example #9
Source File: AppenderCmdHandlerProvider.java From DBus with Apache License 2.0 | 5 votes |
@Override public Map<Command, BoltCommandHandler> provideHandlers(DbusDatasourceType type) { Map<Command, BoltCommandHandler> map = Maps.newHashMap(); map.put(Command.APPENDER_RELOAD_CONFIG, new CommonReloadHandler(listener)); map.put(Command.APPENDER_TOPIC_RESUME, new AppenderResumeHandler(listener)); map.put(Command.FULL_DATA_PULL_REQ, new AppenderInitialLoadHandler(listener)); map.put(Command.HEART_BEAT, new AppenderHeartbeatHandler(listener)); return map; }
Example #10
Source File: WrapperCmdHandlerProvider.java From DBus with Apache License 2.0 | 5 votes |
@Override public Map<Command, BoltCommandHandler> provideHandlers(DbusDatasourceType type) { Map<Command, BoltCommandHandler> map = Maps.newHashMap(); map.put(Command.HEART_BEAT, new CommonHeartbeatHandler(listener)); map.put(Command.APPENDER_RELOAD_CONFIG, new FilteredReloadCommandHandler(listener)); map.put(Command.DATA_INCREMENT_TERMINATION, new CommonTerminationHandler(listener)); /** * 在此处添加新的handler * 目的是处理拉全量之后需要重新从zk中获取UMS_UID * 否则后续的一段时间之内,增量的UMS_UID将比全量的小 */ map.put(Command.APPENDER_TOPIC_RESUME, new WrapperResumeHandler(listener)); return map; }
Example #11
Source File: Convertor.java From DBus with Apache License 2.0 | 5 votes |
private static Map<String, Object> convert2map(List<Column> cols) { Map<String, Object> map = Maps.newHashMap(); if (cols != null) { for (Column col : cols) { String colName = col.getName(); if (col.getIsNull()) { map.put(colName, null); } else { map.put(colName, col.getValue()); } } } return map; }
Example #12
Source File: KafkaWriterCmdHandlerProvider.java From DBus with Apache License 2.0 | 5 votes |
@Override public Map<Command, BoltCommandHandler> provideHandlers(DbusDatasourceType type) { Map<Command, BoltCommandHandler> map = Maps.newHashMap(); map.put(Command.APPENDER_RELOAD_CONFIG, new ReloadCommandHandler(listener)); map.put(Command.HEART_BEAT, new HeartbeatHandler(listener, tableStatReporter, new OracleHeartbeatHandler(listener))); map.put(Command.DATA_INCREMENT_TERMINATION, new IncrementTerminationHandler(listener)); return map; }
Example #13
Source File: AppenderCmdHandlerProvider.java From DBus with Apache License 2.0 | 5 votes |
@Override public Map<Command, BoltCommandHandler> provideHandlers(DbusDatasourceType type) { Map<Command, BoltCommandHandler> map = Maps.newHashMap(); map.put(Command.APPENDER_RELOAD_CONFIG, new CommonReloadHandler(listener)); map.put(Command.APPENDER_TOPIC_RESUME, new AppenderResumeHandler(listener)); map.put(Command.FULL_DATA_PULL_REQ, new AppenderInitialLoadHandler(listener)); map.put(Command.META_SYNC, new MetaSyncEventHandler(listener)); map.put(Command.HEART_BEAT, new AppenderHeartbeatHandler(listener)); map.put(Command.AVRO_SCHEMA, new AvroSchemaHandler()); return map; }
Example #14
Source File: WrapperCmdHandlerProvider.java From DBus with Apache License 2.0 | 5 votes |
@Override public Map<Command, BoltCommandHandler> provideHandlers(DbusDatasourceType type) { Map<Command, BoltCommandHandler> map = Maps.newHashMap(); map.put(Command.HEART_BEAT, new CommonHeartbeatHandler(listener)); map.put(Command.APPENDER_RELOAD_CONFIG, new FilteredReloadCommandHandler(listener)); map.put(Command.DATA_INCREMENT_TERMINATION, new CommonTerminationHandler(listener)); /** * 在此处添加新的handler * 目的是处理拉全量之后需要重新从zk中获取UMS_UID * 否则后续的一段时间之内,增量的UMS_UID将比全量的小 */ map.put(Command.APPENDER_TOPIC_RESUME, new WrapperResumeHandler(listener)); return map; }
Example #15
Source File: DispatcherCmdHandlerProvider.java From DBus with Apache License 2.0 | 5 votes |
@Override public Map<Command, BoltCommandHandler> provideHandlers(DbusDatasourceType type) { Map<Command, BoltCommandHandler> map = Maps.newHashMap(); map.put(Command.APPENDER_RELOAD_CONFIG, new CommonReloadHandler(listener)); map.put(Command.APPENDER_TOPIC_RESUME, new DispatcherResumeHandler(listener)); map.put(Command.FULL_DATA_PULL_REQ, new DispatcherInitialLoadHandler(listener)); map.put(Command.AVRO_SCHEMA, new com.creditease.dbus.stream.oracle.appender.bolt.processor.dispatcher.AvroSchemaHandler(listener)); return map; }
Example #16
Source File: BoltCommandHandlerHelper.java From DBus with Apache License 2.0 | 5 votes |
private static Map<String, Object> convert2map(GenericRecord record) { Map<String, Object> map = Maps.newHashMap(); if (record != null) { List<Schema.Field> fields = record.getSchema().getFields(); for (Schema.Field field : fields) { String key = field.name(); map.put(key, record.get(key)); } } return map; }
Example #17
Source File: BoltCommandHandlerHelper.java From DBus with Apache License 2.0 | 5 votes |
private static Map<String, Object> convert2map(GenericRecord record) { Map<String, Object> map = Maps.newHashMap(); if (record != null) { List<Schema.Field> fields = record.getSchema().getFields(); for (Schema.Field field : fields) { String key = field.name(); map.put(key, record.get(key)); } } return map; }
Example #18
Source File: KafkaWriterCmdHandlerProvider.java From DBus with Apache License 2.0 | 5 votes |
@Override public Map<Command, BoltCommandHandler> provideHandlers(DbusDatasourceType type) { Map<Command, BoltCommandHandler> map = Maps.newHashMap(); map.put(Command.APPENDER_RELOAD_CONFIG, new ReloadCommandHandler(listener)); map.put(Command.HEART_BEAT, new HeartbeatHandler(listener, tableStatReporter)); map.put(Command.DATA_INCREMENT_TERMINATION, new IncrementTerminationHandler(listener)); return map; }
Example #19
Source File: AppenderCmdHandlerProvider.java From DBus with Apache License 2.0 | 5 votes |
@Override public Map<Command, BoltCommandHandler> provideHandlers(DbusDatasourceType type) { Map<Command, BoltCommandHandler> map = Maps.newHashMap(); map.put(Command.APPENDER_RELOAD_CONFIG, new CommonReloadHandler(listener)); map.put(Command.APPENDER_TOPIC_RESUME, new AppenderResumeHandler(listener)); map.put(Command.FULL_DATA_PULL_REQ, new AppenderInitialLoadHandler(listener)); map.put(Command.HEART_BEAT, new AppenderHeartbeatHandler(listener)); map.put(Command.META_SYNC, new MaMetaSyncEventHandler(listener)); return map; }
Example #20
Source File: WrapperCmdHandlerProvider.java From DBus with Apache License 2.0 | 5 votes |
@Override public Map<Command, BoltCommandHandler> provideHandlers(DbusDatasourceType type) { Map<Command, BoltCommandHandler> map = Maps.newHashMap(); map.put(Command.HEART_BEAT, new CommonHeartbeatHandler(listener)); map.put(Command.APPENDER_RELOAD_CONFIG, new FilteredReloadCommandHandler(listener)); map.put(Command.DATA_INCREMENT_TERMINATION, new CommonTerminationHandler(listener)); /** * 在此处添加新的handler * 目的是处理拉全量之后需要重新从zk中获取UMS_UID * 否则后续的一段时间之内,增量的UMS_UID将比全量的小 */ map.put(Command.APPENDER_TOPIC_RESUME, new WrapperResumeHandler(listener)); return map; }
Example #21
Source File: DispatcherCmdHandlerProvider.java From DBus with Apache License 2.0 | 5 votes |
@Override public Map<Command, BoltCommandHandler> provideHandlers(DbusDatasourceType type) { Map<Command, BoltCommandHandler> map = Maps.newHashMap(); map.put(Command.APPENDER_RELOAD_CONFIG, new CommonReloadHandler(listener)); map.put(Command.APPENDER_TOPIC_RESUME, new DispatcherResumeHandler(listener)); map.put(Command.FULL_DATA_PULL_REQ, new DispatcherInitialLoadHandler(listener)); return map; }
Example #22
Source File: HeartbeatCmdHandlerProvider.java From DBus with Apache License 2.0 | 4 votes |
@Override public Map<Command, BoltCommandHandler> provideHandlers(DbusDatasourceType type) { Map<Command, BoltCommandHandler> map = Maps.newHashMap(); map.put(Command.APPENDER_RELOAD_CONFIG, new HeartbeatReloadHandler(listener)); return map; }
Example #23
Source File: HeartbeatCmdHandlerProvider.java From DBus with Apache License 2.0 | 4 votes |
@Override public Map<Command, BoltCommandHandler> provideHandlers(DbusDatasourceType type) { Map<Command, BoltCommandHandler> map = Maps.newHashMap(); map.put(Command.APPENDER_RELOAD_CONFIG, new HeartbeatReloadHandler(listener)); return map; }
Example #24
Source File: BoltHandlerManager.java From DBus with Apache License 2.0 | 4 votes |
public BoltHandlerManager(BoltCommandHandlerProvider provider) { this.provider = provider; this.datasourceType = GlobalCache.getDatasourceType(); this.handlers = Maps.newHashMap(); this.buildCommandHandlers(); }
Example #25
Source File: HeartbeatCmdHandlerProvider.java From DBus with Apache License 2.0 | 4 votes |
@Override public Map<Command, BoltCommandHandler> provideHandlers(DbusDatasourceType type) { Map<Command, BoltCommandHandler> map = Maps.newHashMap(); map.put(Command.APPENDER_RELOAD_CONFIG, new HeartbeatReloadHandler(listener)); return map; }
Example #26
Source File: HeartbeatCmdHandlerProvider.java From DBus with Apache License 2.0 | 4 votes |
@Override public Map<Command, BoltCommandHandler> provideHandlers(DbusDatasourceType type) { Map<Command, BoltCommandHandler> map = Maps.newHashMap(); map.put(Command.APPENDER_RELOAD_CONFIG, new HeartbeatReloadHandler(listener)); return map; }
Example #27
Source File: BillingCostTransitionConverter.java From nomulus with Apache License 2.0 | 4 votes |
@Override Map.Entry<String, String> convertToDatabaseMapEntry( Map.Entry<DateTime, BillingCostTransition> entry) { return Maps.immutableEntry(entry.getKey().toString(), entry.getValue().getValue().toString()); }
Example #28
Source File: BillingCostTransitionConverter.java From nomulus with Apache License 2.0 | 4 votes |
@Override Map.Entry<DateTime, Money> convertToEntityMapEntry(Map.Entry<String, String> entry) { return Maps.immutableEntry(DateTime.parse(entry.getKey()), Money.parse(entry.getValue())); }