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); } } }
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); } } }