Preconditions.checkNotNull(type);
logger.info("Creating instance of sink: {}, type: {}", name, type);
String sinkClassName = type;
SinkType sinkType = SinkType.OTHER;
try {
sinkType = SinkType.valueOf(type.toUpperCase());
} catch (IllegalArgumentException ex) {
logger.debug("Sink type {} is a custom type", type);
}
if (!sinkType.equals(SinkType.OTHER)) {
sinkClassName = sinkType.getSinkClassName();
}
Class<? extends Sink> sinkClass = null;
try {
sinkClass = (Class<? extends Sink>) Class.forName(sinkClassName);