@Override public String toString() { return this.getClass().getName() + "{name:" + name + ", channel:" + channel.getName() + "}"; } }
/** * * @return A map of name to channel instance. */ protected Map<String, Channel> getChannelNameMap() { Map<String, Channel> channelNameMap = new HashMap<String, Channel>(); for (Channel ch : getAllChannels()) { channelNameMap.put(ch.getName(), ch); } return channelNameMap; }
private void checkSinkChannelCompatibility(Sink sink, Channel channel) throws InstantiationException { if (sink instanceof BatchSizeSupported && channel instanceof TransactionCapacitySupported) { long transCap = ((TransactionCapacitySupported) channel).getTransactionCapacity(); long batchSize = ((BatchSizeSupported) sink).getBatchSize(); if (transCap < batchSize) { String msg = String.format( "Incompatible sink and channel settings defined. " + "sink's batch size is greater than the channels transaction capacity. " + "Sink: %s, batch size = %d, channel %s, transaction capacity = %d", sink.getName(), batchSize, channel.getName(), transCap); throw new InstantiationException(msg); } } }
private void checkSourceChannelCompatibility(Source source, Channel channel) throws InstantiationException { if (source instanceof BatchSizeSupported && channel instanceof TransactionCapacitySupported) { long transCap = ((TransactionCapacitySupported) channel).getTransactionCapacity(); long batchSize = ((BatchSizeSupported) source).getBatchSize(); if (transCap < batchSize) { String msg = String.format( "Incompatible source and channel settings defined. " + "source's batch size is greater than the channels transaction capacity. " + "Source: %s, batch size = %d, channel %s, transaction capacity = %d", source.getName(), batchSize, channel.getName(), transCap); throw new InstantiationException(msg); } } }
&& !supervisor.isComponentInErrorState(ch)) { try { logger.info("Waiting for channel: " + ch.getName() + " to start. Sleeping for 500 ms"); Thread.sleep(500);
for (Channel channel : sourceChannels) { ChannelComponent channelComponent = Preconditions.checkNotNull(channelComponentMap.get(channel.getName()), String.format("Channel %s", channel.getName())); channelComponent.components.add(sourceName); for (Channel channel : sourceChannels) { ChannelComponent channelComponent = Preconditions.checkNotNull(channelComponentMap.get(channel.getName()), String.format("Channel %s", channel.getName())); channelComponent.components.add(sourceName);
} else if (t instanceof ChannelException) { logger.error("Rpc Sink " + getName() + ": Unable to get event from" + " channel " + channel.getName() + ". Exception follows.", t); sinkCounter.incrementChannelReadFail(); status = Status.BACKOFF;
myChannel.getName() + ". Exception follows.", t); sinkCounter.incrementEventWriteOrChannelFail(t); try {
@Override public String toString() { return this.getClass().getName() + "{name:" + name + ", channel:" + channel.getName() + "}"; } }
/** * * @return A map of name to channel instance. */ protected Map<String, Channel> getChannelNameMap() { Map<String, Channel> channelNameMap = new HashMap<String, Channel>(); for (Channel ch : getAllChannels()) { channelNameMap.put(ch.getName(), ch); } return channelNameMap; }
if (channel.getName().equals(channelName)) { break;
channelColumns += ",\"" + channel.getName() + "\"";
private void checkSinkChannelCompatibility(Sink sink, Channel channel) throws InstantiationException { if (sink instanceof BatchSizeSupported && channel instanceof TransactionCapacitySupported) { long transCap = ((TransactionCapacitySupported) channel).getTransactionCapacity(); long batchSize = ((BatchSizeSupported) sink).getBatchSize(); if (transCap < batchSize) { String msg = String.format( "Incompatible sink and channel settings defined. " + "sink's batch size is greater than the channels transaction capacity. " + "Sink: %s, batch size = %d, channel %s, transaction capacity = %d", sink.getName(), batchSize, channel.getName(), transCap); throw new InstantiationException(msg); } } }
private void checkSourceChannelCompatibility(Source source, Channel channel) throws InstantiationException { if (source instanceof BatchSizeSupported && channel instanceof TransactionCapacitySupported) { long transCap = ((TransactionCapacitySupported) channel).getTransactionCapacity(); long batchSize = ((BatchSizeSupported) source).getBatchSize(); if (transCap < batchSize) { String msg = String.format( "Incompatible source and channel settings defined. " + "source's batch size is greater than the channels transaction capacity. " + "Source: %s, batch size = %d, channel %s, transaction capacity = %d", source.getName(), batchSize, channel.getName(), transCap); throw new InstantiationException(msg); } } }
selectorProperties.put("mapping.VIEWED", HDFSChannel.getName() + " " + ESChannel.getName() + " " + sparkAvroChannel.getName() + " " + HbaseChannel.getName()); selectorProperties.put("mapping.FAVOURITE", HDFSChannel.getName() + " " + ESChannel.getName() + " " + sparkAvroChannel.getName() + " " + HbaseChannel.getName()); selectorProperties.put("default", HDFSChannel.getName() + " " + sparkAvroChannel.getName() + " " + HbaseChannel.getName()); Context selectorContext = new Context(selectorProperties); selector.configure(selectorContext);
&& !supervisor.isComponentInErrorState(ch)) { try { logger.info("Waiting for channel: " + ch.getName() + " to start. Sleeping for 500 ms"); Thread.sleep(500);
for (Channel channel : sourceChannels) { ChannelComponent channelComponent = Preconditions.checkNotNull(channelComponentMap.get(channel.getName()), String.format("Channel %s", channel.getName())); channelComponent.components.add(sourceName); for (Channel channel : sourceChannels) { ChannelComponent channelComponent = Preconditions.checkNotNull(channelComponentMap.get(channel.getName()), String.format("Channel %s", channel.getName())); channelComponent.components.add(sourceName);
jsonStr += "{\"name\":\"" + channel.getName() + "\"," + "\"status\":\"" + channel.getLifecycleState().toString() + "\",";
} else if (t instanceof ChannelException) { logger.error("Rpc Sink " + getName() + ": Unable to get event from" + " channel " + channel.getName() + ". Exception follows.", t); sinkCounter.incrementChannelReadFail(); status = Status.BACKOFF;
myChannel.getName() + ". Exception follows.", t); sinkCounter.incrementEventWriteOrChannelFail(t); try {