Refine search
@PluginFactory public static NameFilter createFilter( @PluginAttribute("loggingLevel") final String loggingLevel) { // Name required for routing. Error out if it is not set. Preconditions.checkNotNull(loggingLevel, "loggingLevel must be specified for " + NameFilter.class.getName()); return new NameFilter(OperationLog.getLoggingLevel(loggingLevel)); } }
@PluginFactory public static PurgePolicy createPurgePolicy( @PluginAttribute("name") final String name) { // Name required for routing. Error out if it is not set. Preconditions.checkNotNull(name, "Name must be specified for " + LlapRoutingAppenderPurgePolicy.class.getName()); LlapRoutingAppenderPurgePolicy llapRoutingAppenderPurgePolicy = new LlapRoutingAppenderPurgePolicy(name); LlapRoutingAppenderPurgePolicy old = INSTANCES.putIfAbsent(name, llapRoutingAppenderPurgePolicy); if (old != null) { LOGGER.debug("Attempt to create multiple instances of " + LlapRoutingAppenderPurgePolicy.class.getName() + " with the name " + name + ". Using original instance"); llapRoutingAppenderPurgePolicy = old; } return llapRoutingAppenderPurgePolicy; } }
@PluginFactory public static MemoryAppender createAppender( @PluginElement("Layout") Layout<? extends Serializable> layout, @PluginElement("Filter") final Filter filter, @PluginAttribute("name") final String name, @PluginAttribute(value = "bufferSize", defaultInt = 500) final String bufferSize, @PluginAttribute(value = "ignoreExceptions", defaultBoolean = true) final String ignore) { if (name == null) { LOGGER.error("No name provided for MemoryAppender"); return null; } if (layout == null) { layout = PatternLayout.createDefaultLayout(); } final int size = Integer.parseInt(bufferSize); final boolean ignoreExceptions = Booleans.parseBoolean(ignore, true); return new MemoryAppender(name, filter, layout, ignoreExceptions, size); }
@PluginFactory public static HiveEventCounter createInstance(@PluginAttribute("name") String name, @PluginAttribute("ignoreExceptions") boolean ignoreExceptions, @PluginElement("Layout") Layout layout, @PluginElement("Filters") Filter filter) { if (name == null) { name = APPENDER_NAME; } if (layout == null) { layout = PatternLayout.createDefaultLayout(); } return new HiveEventCounter(name, filter, layout, ignoreExceptions); }
@PluginFactory public static HiveEventCounter createInstance(@PluginAttribute("name") String name, @PluginAttribute("ignoreExceptions") boolean ignoreExceptions, @PluginElement("Layout") Layout layout, @PluginElement("Filters") Filter filter) { if (name == null) { name = APPENDER_NAME; } if (layout == null) { layout = PatternLayout.createDefaultLayout(); } return new HiveEventCounter(name, filter, layout, ignoreExceptions); }
@PluginFactory public static LlapWrappedAppender createAppender( @PluginAttribute("name") final String name, // This isn't really used for anything. @PluginAttribute("renameFileOnClose") final String renameFileOnCloseProvided, @PluginAttribute("renamedFileSuffix") final String renamedFileSuffixProvided, @PluginNode final Node node, @PluginConfiguration final Configuration config ) { if (config == null) { LOGGER.error("PluginConfiguration not expected to be null"); return null; } if (node == null) { LOGGER.error("Node must be specified as an appender specification"); return null; } boolean renameFileOnClose = DEFAULT_RENAME_FILES_ON_CLOSE; if (Strings.isNotBlank(renameFileOnCloseProvided)) { renameFileOnClose = Boolean.parseBoolean(renameFileOnCloseProvided); } String renamedFileSuffix = DEFAULT_RENAMED_FILE_SUFFIX; if (Strings.isNotBlank(renamedFileSuffixProvided)) { renamedFileSuffix = renamedFileSuffixProvided; } return new LlapWrappedAppender(name, node, config, renameFileOnClose, renamedFileSuffix); }
@PluginFactory public static HangingAppender createAppender( @PluginAttribute("name") @Required(message = "No name provided for HangingAppender") final String name, @PluginAttribute("delay") final long delay, @PluginAttribute("startupDelay") final long startupDelay, @PluginAttribute("shutdownDelay") final long shutdownDelay, @PluginElement("Layout") final Layout<? extends Serializable> layout, @PluginElement("Filter") final Filter filter) { return new HangingAppender(name, delay, startupDelay, shutdownDelay); }
@PluginFactory public static CapturingLogAppender createAppender(@PluginAttribute("name") String name) { return new CapturingLogAppender(name, null, null); } }
@PluginFactory public static HushableRandomAccessFileAppender createAppender( @PluginAttribute("fileName") final String fileName, @PluginAttribute("append") final String append, @PluginAttribute("name") final String name, @PluginAttribute("immediateFlush") final String immediateFlush, @PluginAttribute("bufferSize") final String bufferSizeStr, @PluginAttribute("ignoreExceptions") final String ignore, @PluginElement("Layout") Layout<? extends Serializable> layout, @PluginElement("Filter") final Filter filter, @PluginAttribute("advertise") final String advertise, @PluginAttribute("advertiseURI") final String advertiseURI, @PluginConfiguration final Configuration config) {
@PluginFactory public static HostAndPort createPlugin( @ValidHost(message = "Unit test (host)") @PluginAttribute("host") final String host, @ValidPort(message = "Unit test (port)") @PluginAttribute("port") final int port) { return new HostAndPort(new InetSocketAddress(host, port)); }
@PluginFactory public static DeadlockAppender createAppender( @PluginAttribute("name") @Required(message = "A name for the Appender must be specified") final String name) { return new DeadlockAppender(name); }
@PluginFactory public static FailOnceAppender createAppender( @PluginAttribute("name") @Required(message = "A name for the Appender must be specified") final String name) { return new FailOnceAppender(name); }
@PluginFactory public static AlwaysFailAppender createAppender( @PluginAttribute("name") @Required(message = "A name for the Appender must be specified") final String name) { return new AlwaysFailAppender(name); }
@PluginFactory public static BlockingAppender createAppender( @PluginAttribute("name") @Required(message = "A name for the Appender must be specified") final String name) { return new BlockingAppender(name); } }
@PluginFactory public static UsesLoggingAppender createAppender( @PluginAttribute("name") @Required(message = "A name for the Appender must be specified") final String name, @PluginAttribute("ignoreExceptions") final boolean ignore, @PluginElement("Layout") final Layout<?> layout, @PluginElement("Filter") final Filter filter) { return new UsesLoggingAppender(name, filter, layout, ignore); }
@PluginFactory public static StringAppender createStringAppender( @PluginAttribute("name") String nullablePatternString) { PatternLayout layout; if (nullablePatternString == null) { layout = PatternLayout.createDefaultLayout(); } else { layout = PatternLayout.createLayout(nullablePatternString, null, configuration, null, null, true, false, null, null); } return new StringAppender(APPENDER_NAME, layout, null, false, true, new StringOutputStreamManager(new ByteArrayOutputStream(), "StringStream", layout)); }
@PluginFactory public static BlockingAppender createAppender( @PluginAttribute("name") @Required(message = "No name provided for HangingAppender") final String name, @PluginElement("Layout") final Layout<? extends Serializable> layout, @PluginElement("Filter") final Filter filter) { return new BlockingAppender(name); }
@PluginFactory public static InstrumentedAppender createAppender( @PluginAttribute("name") String name) { if (name == null) { LOGGER.error("No name provided for InstrumentedAppender"); return null; } return new InstrumentedAppender(name); }
@PluginFactory public static ZebraRolloverStrategy createStrategy( @PluginAttribute("max") final String max, @PluginAttribute("min") final String min, @PluginAttribute("fileIndex") final String fileIndex, @PluginAttribute("compressionLevel") final String compressionLevelStr, @PluginConfiguration final Configuration config) { final boolean useMax = fileIndex == null ? true : fileIndex.equalsIgnoreCase("max");
@PluginFactory public static Log4j1XmlLayout createLayout( // @formatter:off @PluginAttribute(value = "locationInfo") final boolean locationInfo, @PluginAttribute(value = "properties") final boolean properties // @formatter:on ) { return new Log4j1XmlLayout(locationInfo, properties); }