Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
throw new UnsupportedOperationException( "Extract for time unit: " + unit + " not supported!");
0
protected EditCommand(final T object) {
0
if (null == pi.getValue())
0
/* * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * */ package org.apache.hc.client5.http.client.fluent; class HttpHeader { public static final String CONTENT_LENGTH = "Content-Length"; public static final String DATE = "Date"; public static final String CACHE_CONTROL = "Cache-Control"; public static final String CONTENT_TYPE = "Content-Type"; public static final String IF_MODIFIED_SINCE = "If-Modified-Since"; public static final String IF_UNMODIFIED_SINCE = "If-Unmodified-Since"; }
0
protected void populateIngestPrams(IngestParams params) { } public IngestParams getIngestPrams() { IngestParams params = new IngestParams(getClientProps(), tableName); populateIngestPrams(params);
0
package org.apache.felix.sigil.ui.eclipse;
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/UnmodifiableOrderedMapIterator.java,v 1.2 2003/12/01 22:49:00 scolebourne Exp $ import org.apache.commons.collections.OrderedMapIterator; * @version $Revision: 1.2 $ $Date: 2003/12/01 22:49:00 $
0
import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; new MultiInputStream(prologInputStream, decryptInputStream, epilogInputStream), StandardCharsets.UTF_8.name()); return new UnsyncByteArrayInputStream(stringBuilder.toString().getBytes(StandardCharsets.UTF_8)); return new UnsyncByteArrayInputStream(stringBuilder.toString().getBytes(StandardCharsets.UTF_8)); new OutputStreamWriter(base64OutputStream, Charset.forName(inputProcessorChain.getDocumentContext().getEncoding()));
0
private static final int DEFAULT_MAX_SUBNEGOTIATION_LENGTH = 512; final int _maxSubnegotiationLength; this("VT100", DEFAULT_MAX_SUBNEGOTIATION_LENGTH); this(termtype, DEFAULT_MAX_SUBNEGOTIATION_LENGTH); } /** * Construct an instance with the specified max subnegotiation * length and the default terminal-type {@code VT100} * * @param maxSubnegotiationLength the size of the subnegotiation buffer */ public TelnetClient(int maxSubnegotiationLength) { this("VT100", maxSubnegotiationLength); } /** * Construct an instance with the specified terminal type * and max subnegotiation length * * @param termtype the terminal type to use, e.g. {@code VT100} * @param maxSubnegotiationLength the size of the subnegotiation buffer */ public TelnetClient(String termtype, int maxSubnegotiationLength) { /* TERMINAL-TYPE option (start)*/ super(termtype); /* TERMINAL-TYPE option (end)*/ _maxSubnegotiationLength = maxSubnegotiationLength;
0
/** * An implementation of {@link ByteSequence} that uses a backing byte array. */ /** * Creates a new sequence. The given byte array is used directly as the * backing array, so later changes made to the array reflect into the new * sequence. * * @param data byte data */ /** * Creates a new sequence from a subsequence of the given byte array. The * given byte array is used directly as the backing array, so later changes * made to the (relevant portion of the) array reflect into the new sequence. * * @param data byte data * @param offset starting offset in byte array (inclusive) * @param length number of bytes to include in sequence * @throws IllegalArgumentException if the offset or length are out of bounds * for the given byte array */ /** * Creates a new sequence from the given string. The bytes are determined from * the string using the default platform encoding. * * @param s string to represent as bytes */ /** * Creates a new sequence based on a byte buffer. If the byte buffer has an * array, that array (and the buffer's offset and limit) are used; otherwise, * a new backing array is created and a relative bulk get is performed to * transfer the buffer's contents (starting at its current position and * not beyond its limit). * * @param buffer byte buffer */
0
} synchronized (badServers) { Set<TServerInstance> deadBadServers = new HashSet<TServerInstance>(badServers.keySet()); deadBadServers.removeAll(currentServers); if (!badServers.isEmpty()) { log.debug("Forgetting about bad servers: " + badServers); badServers.entrySet().removeAll(deadBadServers);
0
/** Path to the wiring.xml relative to the context root directory */ public static final String WIRING = "wiring.xml"; public static final String BLOCK_META_DIR = "COB-INF"; }
0
import org.apache.cocoon.ProcessingUtil; this.manager = (ServiceManager)this.beanFactory.getBean(ProcessingUtil.SERVICE_MANAGER_ROLE);
0
HttpTransportMetrics getMetrics();
0
/* * Copyright 2003-2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import junit.framework.TestCase; /*** * JUnit test class for InvalidTelnetOptionException * <p> * @author Bruno D'Avanzo ***/ public class InvalidTelnetOptionExceptionTest extends TestCase { private InvalidTelnetOptionException exc1; private String msg1; private int code1; /*** * main for running the test. ***/ public static void main(String args[]) { junit.textui.TestRunner.run(InvalidTelnetOptionExceptionTest.class); } /*** * setUp for the test. ***/ protected void setUp() { msg1 = new String("MSG"); code1 = 13; exc1 = new InvalidTelnetOptionException(msg1, code1); } /*** * test of the constructors. ***/ public void testConstructors() { assertTrue(exc1.getMessage().indexOf(msg1) >= 0); assertTrue(exc1.getMessage().indexOf("" +code1) >= 0); }
0
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */
0
_closed = true;
0
// FIXME non-combinable reduce function not supported without windowing if (!operator.isCombinable()) { throw new UnsupportedOperationException("Non-combinable reduce not supported yet"); }
0
import org.apache.http.conn.SchemeRegistry; private static SchemeRegistry supportedSchemes; //@@@ need better way to pass in the SchemeRegistry or operator supportedSchemes = new SchemeRegistry();
0
public Set<String> getAllowedMethods(final HttpResponse response) { Set<String> methods = new HashSet<String>();
0
* <p>The list of resources returned are required to exist and not represent abstract * resources such as symlinks and directories.
0
import java.awt.font.GlyphMetrics; private GVTGlyphMetrics metrics; this.glyphCode = glyphCode; this.position = new Point2D.Float(0,0); * Returns the metrics of this Glyph if it is used in a horizontal layout. public GVTGlyphMetrics getGlyphMetrics() { metrics = new GVTGlyphMetrics(getHorizAdvX(), getVertAdvY(), glyphNode.getOutline(null).getBounds2D(), GlyphMetrics.COMPONENT); public GVTGlyphMetrics getGlyphMetrics(float hkern, float vkern) { return new GVTGlyphMetrics(getHorizAdvX() - (hkern * kernScale), getVertAdvY() - (vkern * kernScale), glyphNode.getOutline(null).getBounds2D(), GlyphMetrics.COMPONENT);
0
public void testOptionalResolution() throws Exception { RepositoryAdminImpl repoAdmin = createRepositoryAdmin(); repoAdmin.addRepository(getClass().getResource("/repo_for_optional_resources.xml")); Resolver resolver = repoAdmin.resolver(); resolver.add(repoAdmin.requirement("bundle", "(symbolicname=res1)")); assertTrue(resolver.resolve()); assertEquals(1, resolver.getRequiredResources().length); assertEquals(2, resolver.getOptionalResources().length); }
0
__createParser(parserKey); // create and cache parser return initiateListParsing(__entryParser, pathname); } // package access for test purposes void __createParser(String parserKey) throws IOException { // Note: we don't check against a null parserKey (NET-544) if(__entryParser == null || (parserKey != null && ! __entryParserKey.equals(parserKey))) { // Method for use by unit test code only FTPFileEntryParser getEntryParser() { return __entryParser; }
0
Copyright 2001,2003 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */
0
return Constants.COMPONENT;
0
import java.security.PublicKey; public boolean verifyServerKey(ClientSession sshClientSession, SocketAddress remoteAddress, PublicKey serverKey) { log.trace("Accepting key for " + remoteAddress + " key=" + BufferUtils.printHex(serverKey.getEncoded()));
0
/** {@inheritDoc} */ /** {@inheritDoc} */
0
sendQueueSize.decrementAndGet(); sendQueueSize.decrementAndGet();
0
public AsyncQueryRunner(final ExecutorService executorService, final QueryRunner queryRunner) { public AsyncQueryRunner(final ExecutorService executorService) { public AsyncQueryRunner(final boolean pmdKnownBroken, final ExecutorService executorService) { public AsyncQueryRunner(final DataSource ds, final ExecutorService executorService) { public AsyncQueryRunner(final DataSource ds, final boolean pmdKnownBroken, final ExecutorService executorService) { public BatchCallableStatement(final String sql, final Object[][] params, final Connection conn, final boolean closeConn, final PreparedStatement ps) { public QueryCallableStatement(final Connection conn, final boolean closeConn, final PreparedStatement ps, final ResultSetHandler<T> rsh, final String sql, final Object... params) { public UpdateCallableStatement(final Connection conn, final boolean closeConn, final PreparedStatement ps, final String sql, final Object... params) {
0
@Test public void testPzxidUpdatedWhenDeletingNonExistNode() throws Exception { DataNode root = dt.getNode("/"); long currentPzxid = root.stat.getPzxid(); // pzxid updated with deleteNode on higher zxid long zxid = currentPzxid + 1; try { dt.deleteNode("/testPzxidUpdatedWhenDeletingNonExistNode", zxid); } catch (NoNodeException e) { /* expected */ } root = dt.getNode("/"); currentPzxid = root.stat.getPzxid(); Assert.assertEquals(currentPzxid, zxid); // pzxid not updated with smaller zxid long prevPzxid = currentPzxid; zxid = prevPzxid - 1; try { dt.deleteNode("/testPzxidUpdatedWhenDeletingNonExistNode", zxid); } catch (NoNodeException e) { /* expected */ } root = dt.getNode("/"); currentPzxid = root.stat.getPzxid(); Assert.assertEquals(currentPzxid, prevPzxid); }
0
* * * * * * * * * * * * * * * * * * * * * * * * @param value The user specific value. * * * * * * * * * * * * * * * @param value The user specific value. * * @param value The user specific value. * * @param value The user specific value. * * @param value The user specific value.
0
final HeaderIterator it = response.headerIterator("Allow"); final Set<String> methods = new HashSet<String>(); final Header header = it.nextHeader(); final HeaderElement[] elements = header.getElements(); for (final HeaderElement element : elements) {
0
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.ambari.view.hive.resources.uploads; import org.apache.ambari.view.hive.client.ColumnDescription; import java.util.List; public class TableInfo { private String tableName; private String databaseName; private List<ColumnDescription> columns; public String getTableName() { return tableName; } public void setTableName(String tableName) { this.tableName = tableName; } public String getDatabaseName() { return databaseName; } public void setDatabaseName(String databaseName) { this.databaseName = databaseName; } public List<ColumnDescription> getColumns() { return columns; } public void setColumns(List<ColumnDescription> columns) { this.columns = columns; } public TableInfo(String databaseName, String tableName, List<ColumnDescription> columns) { this.tableName = tableName; this.databaseName = databaseName; this.columns = columns; } public TableInfo() { } }
0
public HealthCheckExecutionOptions setForceInstantExecution(boolean forceInstantExecution) { return this; public HealthCheckExecutionOptions setCombineTagsWithOr(boolean combineTagsWithOr) { return this; public HealthCheckExecutionOptions setOverrideGlobalTimeout(int overrideGlobalTimeout) { return this;
0
import java.lang.reflect.Method; import org.apache.accumulo.server.test.MiniAccumuloCluster; import org.apache.accumulo.server.test.MiniAccumuloConfig; // use reflection to call this method so it does not need to be made public Method method = cluster.getClass().getDeclaredMethod("exec", Class.class, String[].class); method.setAccessible(true); traceProcess = (Process) method.invoke(cluster, TraceServer.class, new String[0]);
0
package org.apache.atlas.bridge.hivelineage.hook; import org.apache.atlas.bridge.hivelineage.hook.HiveLineage.CreateColumns; import org.apache.atlas.bridge.hivelineage.hook.HiveLineage.GroupBy; import org.apache.atlas.bridge.hivelineage.hook.HiveLineage.QueryColumns; import org.apache.atlas.bridge.hivelineage.hook.HiveLineage.SourceTables; import org.apache.atlas.bridge.hivelineage.hook.HiveLineage.WhereClause;
1
private final Class<? extends T> type; public BeanListHandler(Class<? extends T> type) { public BeanListHandler(Class<? extends T> type, RowProcessor convert) {
0
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at
0
package org.apache.ambari.metrics.adservice.seriesgenerator;
0
import org.apache.ambari.server.controller.StackVersionResponse; @Override public int hashCode() { int result = 1; result = 31 + name.hashCode() + version.hashCode(); return result; } @Override public boolean equals(Object obj) { if (!(obj instanceof StackInfo)) { return false; } if (this == obj) { return true; } StackInfo stackInfo = (StackInfo) obj; return getName().equals(stackInfo.getName()) && getVersion().equals(stackInfo.getVersion()); } public StackVersionResponse convertToResponse() { return new StackVersionResponse(getVersion()); }
0
import com.twitter.mesos.scheduler.base.JobKeys; import com.twitter.mesos.scheduler.base.Query;
0
/* * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * */ package org.apache.hc.core5.http2.hpack; enum HPackRepresentation { WITH_INDEXING, WITHOUT_INDEXING, NEVER_INDEXED }
0
* <p> * <strong>Note that CompositeMap is not synchronized and is not thread-safe.</strong> * If you wish to use this map from multiple threads concurrently, you must use * appropriate synchronization. The simplest approach is to wrap this map * using {@link java.util.Collections#synchronizedMap(Map)}. This class may throw * exceptions when accessed by concurrent threads without synchronization.
0
public Rectangle2D getPadRect() { setPadRect(blurArea.getRegion()); return super.getPadRect(); }
0
/* * $Id$ * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */
0
import org.apache.ambari.view.pig.utils.BadRequestFormattedException; import org.apache.ambari.view.pig.utils.NotFoundFormattedException; import org.apache.ambari.view.pig.utils.ServiceFormattedException; import org.junit.rules.ExpectedException; @Rule public ExpectedException thrown = ExpectedException.none(); thrown.expect(ServiceFormattedException.class); thrown.expect(BadRequestFormattedException.class); fileService.getFile(filePath, 3L); thrown.expect(NotFoundFormattedException.class); fileService.getFile("/tmp/notExistentFile", 2L); thrown.expect(NotFoundFormattedException.class); fileService.getFile(filePath, 0L);
0
boolean upgrade(
0
* header-value := &lt;any ascii characters except CR &amp; LF&gt;<br>
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jelly/src/java/org/apache/commons/jelly/Script.java,v 1.8 2003/01/24 05:26:13 morgand Exp $ * $Revision: 1.8 $ * $Date: 2003/01/24 05:26:13 $ * $Id: Script.java,v 1.8 2003/01/24 05:26:13 morgand Exp $ * @version $Revision: 1.8 $ public void run(JellyContext context, XMLOutput output) throws JellyException;
0
* Copyright 1999-2002,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ * @version CVS $Id: PersistentAspectDataStore.java,v 1.2 2004/03/05 13:02:10 bdelacretaz Exp $
1
if (xpath2filter.length() > 2 && !Character.isWhitespace(xpath2filter.charAt(0))) {
0
import org.apache.beam.vendor.grpc.v1p21p0.com.google.protobuf.ByteString;
0
* any, must include the following acknowledgement: * Alternately, this acknowledgement may appear in the software itself, * if and wherever such third-party acknowledgements normally appear. * permission of the Apache Software Foundation. * @version $Id: AbstractExecutor.java,v 1.2 2003/10/09 21:28:56 rdonkin Exp $
0
CloudObject encodedCoder = FullWindowedValueCoder.of(FakeKeyedWorkItemCoder.of(coder), IntervalWindow.getCoder()) .asCloudObject(); .setRead( new ReadInstruction() .setSource( new Source() .setSpec(CloudObject.forClass(WindowingWindmillReader.class)) .setCodec(encodedCoder))) .setOutputs( Arrays.asList(new InstructionOutput().setName("read_output").setCodec(encodedCoder)));
0
Assert.assertTrue("Expected less time to be taken with immediate readahead (" + millisWithNoWait + ") than without immediate readahead (" + millisWithWait + ")", millisWithNoWait < millisWithWait);
0
* * * * * * * * *
0
Copyright 2000-2004 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */
0
import org.apache.beam.sdk.transforms.ParDo; private static final List<KV<String, String>> PARSED_EVENTS = Arrays.asList( KV.of("VM", "Date: 20141212, Actor1: LAOS, url: http://www.chicagotribune.com"), KV.of("BE", "Date: 20141213, Actor1: AFGHANISTAN, url: http://cnn.com"), KV.of("VM", "Date: 20141212, Actor1: BANGKOK, url: http://cnn.com")); private static final List<KV<String, String>> PARSED_COUNTRY_CODES = Arrays.asList(KV.of("BE", "Belgium"), KV.of("VM", "Vietnam")); PCollection<KV<String, String>> output = p.apply(Create.of(EVENT_ARRAY)).apply(ParDo.of(new ExtractEventDataFn())); PAssert.that(output).containsInAnyOrder(PARSED_EVENTS); p.run().waitUntilFinish(); PCollection<KV<String, String>> output = p.apply(Create.of(CC_ARRAY)).apply(ParDo.of(new ExtractCountryInfoFn())); PAssert.that(output).containsInAnyOrder(PARSED_COUNTRY_CODES); p.run().waitUntilFinish();
0
import java.util.concurrent.TimeUnit; validateConditionIsNotEmpty(condition); validateRowCountLimit(condition); private static void validateConditionIsNotEmpty(Condition condition) { if (condition.isEmpty()) { throw new IllegalArgumentException("Condition is empty."); } } private static void validateRowCountLimit(Condition condition) { if (condition.getMetricNames() == null || condition.getMetricNames().size() ==0 ) { //aggregator can use empty metrics query return; } long range = condition.getEndTime() - condition.getStartTime(); long rowsPerMetric = TimeUnit.MILLISECONDS.toHours(range) + 1; Precision precision = condition.getPrecision(); // for minutes and seconds we can use the rowsPerMetric computed based on // minutes if (precision != null && precision == Precision.HOURS) { rowsPerMetric = TimeUnit.MILLISECONDS.toHours(range) + 1; } long totalRowsRequested = rowsPerMetric * condition.getMetricNames().size(); if (totalRowsRequested > PhoenixHBaseAccessor.RESULTSET_LIMIT) { throw new IllegalArgumentException("The time range query for " + "precision table exceeds row count limit, please query aggregate " + "table instead."); } } validateConditionIsNotEmpty(condition); validateConditionIsNotEmpty(condition); validateConditionIsNotEmpty(condition);
0
import java.io.Serializable; public class GcsPath implements Path, Serializable { private transient FileSystem fs;
0
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.configuration.builder; import org.apache.commons.configuration.tree.ExpressionEngine; /** * <p> * Definition of a parameters interface for hierarchical configurations. * </p> * <p> * This interface defines set methods for additional properties common to all * hierarchical configurations. * </p> * * @version $Id$ * @since 2.0 * @param <T> the type of the result of all set methods for method chaining */ public interface HierarchicalBuilderProperties<T> { /** * Sets the {@code ExpressionEngine} to be used when querying the * configuration. * * @param engine the {@code ExpressionEngine} * @return a reference to this object for method chaining */ T setExpressionEngine(ExpressionEngine engine); }
0
minSessionTimeout = minSessionTimeout == -1 ? tickTime * 2 : minSessionTimeout; maxSessionTimeout = maxSessionTimeout == -1 ? tickTime * 20 : maxSessionTimeout;
0
import static org.hamcrest.core.IsEqual.equalTo; import static org.junit.Assert.assertThat; import nl.jqno.equalsverifier.EqualsVerifier;
0
* @return {@code true} if there is data in the buffer, * {@code false} otherwise.
0
import java.util.concurrent.atomic.AtomicReference; import org.apache.hc.core5.function.Supplier; private final Supplier<AsyncEntityConsumer<T>> dataConsumerSupplier; private final AtomicReference<AsyncEntityConsumer<T>> dataConsumerRef; public BasicRequestConsumer(final Supplier<AsyncEntityConsumer<T>> dataConsumerSupplier) { this.dataConsumerSupplier = Args.notNull(dataConsumerSupplier, "Data consumer supplier"); this.dataConsumerRef = new AtomicReference<>(null); } this(new Supplier<AsyncEntityConsumer<T>>() { @Override public AsyncEntityConsumer<T> get() { return dataConsumer; } }); final AsyncEntityConsumer<T> dataConsumer = dataConsumerSupplier.get(); if (dataConsumer == null) { throw new HttpException("Supplied data consumer is null"); } dataConsumerRef.set(dataConsumer); final Message<HttpRequest, T> result = new Message<>(request, body); final Message<HttpRequest, T> result = new Message<>(request, null); final AsyncEntityConsumer<T> dataConsumer = dataConsumerRef.get(); final AsyncEntityConsumer<T> dataConsumer = dataConsumerRef.get(); final AsyncEntityConsumer<T> dataConsumer = dataConsumerRef.get(); final AsyncEntityConsumer<T> dataConsumer = dataConsumerRef.getAndSet(null);
0
import com.google.cloud.dataflow.sdk.testing.RestoreDataflowLoggingFormatter; @Rule public TestRule restoreMDC = new RestoreDataflowLoggingFormatter(); DataflowWorkerLoggingFormatter.setJobId("testJobId"); DataflowWorkerLoggingFormatter.setWorkerId("testWorkerId"); DataflowWorkerLoggingFormatter.setWorkId("testWorkId"); DataflowWorkerLoggingFormatter.setJobId("testJobId"); DataflowWorkerLoggingFormatter.setWorkerId("testWorkerId"); DataflowWorkerLoggingFormatter.setWorkId("testWorkId"); DataflowWorkerLoggingFormatter.setJobId("testJobId"); DataflowWorkerLoggingFormatter.setWorkerId("testWorkerId"); DataflowWorkerLoggingFormatter.setWorkId("testWorkId"); DataflowWorkerLoggingFormatter.setJobId("testJobId"); DataflowWorkerLoggingFormatter.setWorkerId("testWorkerId"); DataflowWorkerLoggingFormatter.setWorkId("testWorkId");
0
public static final Set<KexState> VALUES = Collections.unmodifiableSet(EnumSet.allOf(KexState.class));
0
import java.util.Arrays; import java.util.List; protected String op; @Override public List<GroovyExpression> getChildren() { return Arrays.asList(left, right); }
0
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.cauldron.sigil.ui.util; import java.util.Collection; import java.util.LinkedList; public abstract class AccumulatorAdapter<E> implements IAccumulator<E> { public void addElement(E element) { LinkedList<E> list = new LinkedList<E>(); list.add(element); addElements(list); }; public void addElements(Collection<? extends E> elements) { } }
0
import org.apache.ambari.view.pig.utils.MisconfigurationFormattedException; import org.apache.ambari.view.pig.utils.ServiceFormattedException; hdfsApi = connectToHDFSApi(context); protected static HdfsApi connectToHDFSApi(ViewContext context) { HdfsApi api = null; Thread.currentThread().setContextClassLoader(null); String defaultFS = context.getProperties().get("dataworker.defaultFs"); if (defaultFS == null) { String message = "dataworker.defaultFs is not configured!"; LOG.error(message); throw new MisconfigurationFormattedException("dataworker.defaultFs"); } try { api = new HdfsApi(defaultFS, getHdfsUsername(context)); LOG.info("HdfsApi connected OK"); } catch (IOException e) { String message = "HdfsApi IO error: " + e.getMessage(); LOG.error(message); throw new ServiceFormattedException(message, e); } catch (InterruptedException e) { String message = "HdfsApi Interrupted error: " + e.getMessage(); LOG.error(message); throw new ServiceFormattedException(message, e); } return api; }
0
import java.util.concurrent.atomic.AtomicBoolean; private final AtomicBoolean started = new AtomicBoolean(false); public boolean isStarted() { return started.get(); } * Ignored if already {@link #isStarted() started} if (isStarted()) { return; } started.set(true); if (!started.getAndSet(false)) { return; }
0
* By default, propagated service properties don't override the component service properties. It means
0
public class UpdateThread implements Runnable private final ConfigurationManager configurationManager; // the thread's base name private final String workerBaseName; private final LinkedList updateTasks; // the actual thread private final Thread worker; public UpdateThread( final ConfigurationManager configurationManager, final ThreadGroup tg, final String name ) { this.workerBaseName = name; this.worker = new Thread( tg, this, name ); this.worker.setDaemon( true ); this.worker.start(); worker.setName( workerBaseName + " (" + task + ")" ); worker.setName( workerBaseName ); // of the queue and wait for the thread to actually terminate // wait for all updates to terminate try { worker.join(); } catch ( InterruptedException ie ) { // don't really care }
0
/** * Required by JDK1.6. */ public Object unwrap(Class iface) throws SQLException { return null; } /** * Required by JDK1.6. */ public boolean isWrapperFor(Class iface) throws SQLException { return false; }
0
final String normForm = "a&b&c"; normalized("b&c&a", normForm, "c&b&a", normForm, "a&(b&c)", normForm, "(a&c)&b", normForm); // this an expression that's basically `expr | expr` normalized("(d&c&b&a)|(b&c&a&d)", "a&b&c&d");
1
import com.google.common.base.Strings; private static final String ZK_HIVE_DYN_SERVICE_DISCOVERY_KEY = "hive.server2.support.dynamic.service.discovery"; private static final String ZK_HIVE_NAMESPACE_KEY = "hive.server2.zookeeper.namespace"; private static final String ZK_HIVE_QUORUM = "hive.zookeeper.quorum"; private static final String AMBARI_HIVE_SERVICE_NAME = "HIVE"; private static final String AMBARI_HIVESERVER_COMPONENT_NAME = "HIVE_SERVER"; private static final String HIVE_SITE = "hive-site"; private static final String HIVE_INTERACTIVE_SITE = "hive-interactive-site"; private static final String HIVE_JDBC_URL_KEY = "hive.jdbc.url"; private static final String BINARY_PORT_KEY = "hive.server2.thrift.port"; private static final String HTTP_PORT_KEY = "hive.server2.thrift.http.port"; private static final String HIVE_TRANSPORT_MODE_KEY = "hive.server2.transport.mode"; private static final String HTTP_PATH_KEY = "hive.server2.thrift.http.path"; String sessionParams = context.getProperties().get(HIVE_SESSION_PARAMS); String formatted = String.format("jdbc:hive2://%s/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=%s", quorum, namespace); if(!Strings.isNullOrEmpty(sessionParams)){ return formatted + ";" + sessionParams; } return formatted;
0
LOG.debug("Cluster Metrics Vip Host : {}", clusterMetricserverVipHost); LOG.debug("jmxPortMap -> {}", jmxPortMap); LOG.debug("PROPERTY -> key: {}, value: {}", propName, value); LOG.debug("Detected JMX protocol is null for clusterName = {}, componentName = {}", clusterName, componentName); LOG.debug("Defaulting JMX to HTTP protocol for for clusterName = {}, componentName = {}", clusterName, componentName); LOG.debug("JMXProtocol = {}, for clusterName={}, componentName = {}", jmxProtocolString, clusterName, componentName);
1
import org.apache.accumulo.core.iterators.system.MapFileIterator; import org.apache.hadoop.io.MapFile; FileSKVIterator iter = new FileCFSkippingIterator(new RangeIterator(new MapFileIterator(acuconf, fs, file, conf))); return fs.getFileStatus(new Path(file + "/" + MapFile.DATA_FILE_NAME)).getLen(); MapFileIterator mfIter = new MapFileIterator(tableConf, fs, file, conf);
0
@Override public boolean isCollectorHostExternal(String clusterName) { return false; }
0
public H2ServerTlsStrategy(final int... securePorts) {
0
* Interface to the Atlas notification framework. * <p> * Use this interface to create consumers and to send messages of a given notification type. * <ol> * <li>Atlas sends entity notifications * <li>Hooks send notifications to create/update types/entities. Atlas reads these messages * </ol>
0
import org.apache.accumulo.core.util.shell.Token; tableOpt = new Option(Shell.tableOption, "tableName", true, "table to delete");
0
import org.apache.cocoon.portal.event.Event; import org.apache.cocoon.portal.event.impl.FullScreenCopletEvent; * @version CVS $Id: PortletWindowAspect.java,v 1.6 2004/03/15 14:29:09 cziegeler Exp $ Event fullScreenEvent = null; if ( ws.equals(WindowState.MAXIMIZED) ) { fullScreenEvent = new FullScreenCopletEvent( copletInstanceData, null ); } if ( !ws.equals(WindowState.MINIMIZED) && !ws.equals(WindowState.MAXIMIZED)) { XMLUtils.createElement(contenthandler, "minimize-uri", url.toString(fullScreenEvent)); XMLUtils.createElement(contenthandler, "maximize-uri", url.toString(fullScreenEvent)); fullScreenEvent = new FullScreenCopletEvent( copletInstanceData, layout ); XMLUtils.createElement(contenthandler, "fullscreen-uri", url.toString(fullScreenEvent));
0
import org.junit.BeforeClass; } @BeforeClass public static void setUp() { PipelineOptionsFactory.register(TestPipelineOptions.class); options.getAppName(), options.getProject(), query, DEFAULT_OUTPUT_CHECKSUM));
0
import org.apache.ambari.server.ldap.service.AmbariLdapConfigurationProvider; protected AmbariLdapConfigurationProvider ldapConfigurationProvider; if (membershipsToCreate.isEmpty()) { LOG.debug("There are no new memberships for which to process administrator group mapping rules."); return; } AmbariLdapConfiguration ldapConfiguration = ldapConfigurationProvider.get(); if (ldapConfiguration == null) { LOG.warn("The LDAP configuration is not available - no administrator group mappings will be processed."); return; } if (Strings.isNullOrEmpty(adminGroupMappings)) { LOG.debug("There are no administrator group mappings to be processed.");
0
* A simple map reduce job that inserts word counts into accumulo. See the README for instructions * on how to run this. This version does not use the ClientOpts class to parse arguments as an * example of using AccumuloInputFormat and AccumuloOutputFormat directly. See README.mapred for * more details. AccumuloOutputFormat.setZooKeeperInstance(job, ClientConfiguration.loadDefault().withInstance(instance).withZkHosts(zookeepers));
0
import org.apache.sshd.common.util.CloseableUtils; public abstract class AbstractFactoryManager extends CloseableUtils.AbstractCloseable implements FactoryManager {
0
import java.util.HashMap; JexlThreadedArithmetic.setLenient(flag); * <p>Note that the JexlContext is also used to try to solve top-level functions. This allows ObjectContext * derived instances to call methods on the wrapped object.</p> return createScript(scriptText, null, null); * It uses an array of parameter names that will be resolved during parsing; * a corresponding array of arguments containing values should be used during evaluation. * @param names the parameter names public Script createScript(String scriptText, JexlInfo info, String[] names) { ASTJexlScript tree = parse(scriptText, info, names); return createScript(readerToString(reader), info, null); return createScript(readerToString(reader), info, null); return parse(expression, info, null); } protected ASTJexlScript parse(CharSequence expression, JexlInfo info, String[] names) { if (names != null) { Map<String, Integer> params = new HashMap<String, Integer>(); for(int n = 0; n < names.length; ++n) { params.put(names[n], n); } parser.setNamedRegisters(params); } } finally { parser.setNamedRegisters(null);
0
package org.apache.ambari.metrics.alertservice.common; public class MetricAnomaly { private String metricKey; private long timestamp; private double metricValue; private MethodResult methodResult; public MetricAnomaly(String metricKey, long timestamp, double metricValue, MethodResult methodResult) { this.metricKey = metricKey; this.timestamp = timestamp; this.metricValue = metricValue; this.methodResult = methodResult; } public String getMetricKey() { return metricKey; } public void setMetricName(String metricName) { this.metricKey = metricName; } public long getTimestamp() { return timestamp; } public void setTimestamp(long timestamp) { this.timestamp = timestamp; } public double getMetricValue() { return metricValue; } public void setMetricValue(double metricValue) { this.metricValue = metricValue; } public MethodResult getMethodResult() { return methodResult; } public void setMethodResult(MethodResult methodResult) { this.methodResult = methodResult; } public String getAnomalyAsString() { return metricKey + ":" + timestamp + ":" + metricValue + ":" + methodResult.prettyPrint(); } }
0
unregister("/test");
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jelly/src/java/org/apache/commons/jelly/tags/xml/Attic/SetTag.java,v 1.12 2003/01/15 06:42:47 morgand Exp $ * $Revision: 1.12 $ * $Date: 2003/01/15 06:42:47 $ * $Id: SetTag.java,v 1.12 2003/01/15 06:42:47 morgand Exp $ import org.apache.commons.jelly.xpath.XPathComparator; import org.apache.commons.jelly.xpath.XPathTagSupport; * @version $Revision: 1.12 $
0
* * WARNING: THIS CLASS DOES NOT WORK PROPERLY WITH NAMESPACES * @version CVS $Id: MirrorRecorder.java,v 1.2 2003/11/23 17:06:05 vgritsenko Exp $ static class NullEvent implements EventRecorder { throws SAXException { } static class StartEvent implements EventRecorder { private String uri, name, raw; private Attributes attr; Attributes attr) { this.attr = new AttributesImpl(attr); throws SAXException { return new StartEvent(uri, name, raw, attr); if (attr != null) { for(int i = 0; i < attr.getLength(); ++i) { } static class EndEvent implements EventRecorder { private String uri, name, raw; throws SAXException { static class CharacterEvent implements EventRecorder { public CharacterEvent(String ch) { this.ch = ch; public Object clone() { return new CharacterEvent(ch); throws SAXException { Attributes attrs; if(n.getAttributes() instanceof Attributes) { attrs = (Attributes) n.getAttributes(); } else { Node node = map.item(i); final String ns = node.getNamespaceURI() == null? "" : node.getNamespaceURI(); final String ln = node.getLocalName() == null? node.getNodeName() : node.getLocalName(); ((AttributesImpl) attrs).addAttribute(ns, ln, final String ns = n.getNamespaceURI() == null? "" : n.getNamespaceURI(); final String ln = n.getLocalName() == null? n.getNodeName() : n.getLocalName(); startElement(ns, ln, n.getNodeName(), attrs); endElement(ns, ln, n.getNodeName());
0
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
0
boolean debugEnabled = log.isDebugEnabled(); if (debugEnabled) { username, session, e.getClass().getSimpleName(), e.getMessage()); if (debugEnabled) { if (debugEnabled) { if (debugEnabled) { username, session, subMethods, lang, challenge.getInteractionName(), challenge.getInteractionInstruction(), challenge.getLanguageTag(), GenericUtils.size(challenge.getPrompts())); boolean debugEnabled = log.isDebugEnabled(); if (debugEnabled) { if (debugEnabled) { if (debugEnabled) {
0
* {@link ValueState}, {@link BagState}, and {@link GroupingState}.
0
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.ambari.view.hive20.persistence.utils; /** * Thrown when item was not found in DB */ public class ItemNotFound extends Exception { public ItemNotFound() { } public ItemNotFound(String message) { super(message); } public ItemNotFound(String message, Throwable cause) { super(message, cause); } public ItemNotFound(Throwable cause) { super(cause); } public ItemNotFound(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { super(message, cause, enableSuppression, writableStackTrace); } }
0
import org.apache.accumulo.core.client.Accumulo; try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) { try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
0
import org.apache.hc.core5.reactor.ProtocolIOSession; import org.slf4j.Logger; import org.slf4j.LoggerFactory; Assert.assertFalse(ioSession.isClosed()); Assert.assertFalse(ioSession.isClosed()); Assert.assertFalse(ioSession.isClosed()); Assert.assertTrue(ioSession.isClosed()); final ProtocolIOSession ioSession,
0
import static java.nio.charset.StandardCharsets.UTF_8; import java.util.Collections; import org.apache.accumulo.core.Constants; String masterLocPath = getZooKeeperRoot() + Constants.ZMASTER_LOCK; OpTimer timer = null; if (log.isTraceEnabled()) { log.trace("tid={} Looking up master location in zookeeper.", Thread.currentThread().getId()); timer = new OpTimer().start(); } byte[] loc = ZooUtil.getLockData(zooCache, masterLocPath); if (timer != null) { timer.stop(); log.trace("tid={} Found master at {} in {}", Thread.currentThread().getId(), (loc == null ? "null" : new String(loc, UTF_8)), String.format("%.3f secs", timer.scale(TimeUnit.SECONDS))); } if (loc == null) { return Collections.emptyList(); } return Collections.singletonList(new String(loc, UTF_8)); // want the instance id to be stable for the life of this instance object, // so only get it once String instanceNamePath = Constants.ZROOT + Constants.ZINSTANCES + "/" + instanceName; byte[] iidb = zooCache.get(instanceNamePath); if (iidb == null) { throw new RuntimeException( "Instance name " + instanceName + " does not exist in zookeeper. " + "Run \"accumulo org.apache.accumulo.server.util.ListInstances\" to see a list."); } instanceId = new String(iidb, UTF_8); } if (zooCache.get(Constants.ZROOT + "/" + instanceId) == null) { if (instanceName == null) throw new RuntimeException("Instance id " + instanceId + " does not exist in zookeeper"); throw new RuntimeException("Instance id " + instanceId + " pointed to by the name " + instanceName + " does not exist in zookeeper");
0