Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
* 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
0
* Construct object from input stream. * @param input Input stream PMGClass(int name_index, int length, DataInput input, ConstantPool constant_pool) this(name_index, length, input.readUnsignedShort(), input.readUnsignedShort(), constant_pool);
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
/* * 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.accumulo.core.file.blockfile.cache; public enum CacheType { DATA, INDEX, SUMMARY; }
0
public void setSourceResolver(SourceResolver resolver) {
0
* @param file the file to check (ignored) * @param dir the directory to check (ignored) * @param name the filename (ignored)
0
for (Map.Entry<?, ?> entry : ((Map<?, ?>) orig).entrySet()) {
0
hdfs.getServiceComponent(Role.DATANODE.name()).getServiceComponentHost(hostname1).setDesiredState(State.INSTALLED); hdfs.getServiceComponent(Role.NAMENODE.name()).getServiceComponentHost(hostname1).setDesiredState(State.INSTALLED); hdfs.getServiceComponent(Role.SECONDARY_NAMENODE.name()).getServiceComponentHost(hostname1).setDesiredState(State.INSTALLED); hdfs.getServiceComponent(Role.HDFS_CLIENT.name()).getServiceComponentHost(hostname1).setDesiredState(State.INSTALLED); hdfs.getServiceComponent(Role.HDFS_CLIENT.name()).getServiceComponentHost(hostname2).setDesiredState(State.INSTALLED); ("HDFS_CLIENT"); assertEquals(State.INSTALLED, cmd.getDesiredState()); assertEquals(false, cmd.getHasStaleConfigs());
0
import javax.ws.rs.DELETE; import org.apache.ambari.logsearch.common.StatusMessage; public ServiceLogResponse searchServiceLogs(@BeanParam ServiceLogRequest request) { @DELETE @Produces({"application/json"}) @ApiOperation(PURGE_LOGS_OD) public StatusMessage deleteServiceLogs(@BeanParam ServiceLogRequest request) { return serviceLogsManager.deleteLogs(request); }
0
FileSKVIterator dataIter; } else { dataIter = iter;
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. */ /** * Flink Beam runner exemple. */ package org.apache.beam.runners.flink.examples.streaming;
0
/** * Session callback interface used internally by I/O reactor implementations. */
0
import org.apache.accumulo.core.clientImpl.Namespace; import org.apache.accumulo.core.clientImpl.Table; import org.apache.accumulo.core.clientImpl.Tables;
0
map.put(HostComponentResourceProvider.COMPONENT_NAME, "MYCOMPONENT");
0
* @version $Id$
0
@Override
0
import java.awt.Paint; import java.awt.Stroke; import java.awt.font.TextAttribute; import java.text.AttributedCharacterIterator;
0
* limitations under the License.
0
import org.apache.accumulo.cloudtrace.instrument.Span; import org.apache.accumulo.cloudtrace.instrument.Trace;
0
private SignedInfoProcessor signedInfoProcessor;
1
* @version $Id: ConfigurationConverter.java,v 1.4 2004/06/02 16:42:24 ebourg Exp $ Configuration config = new BaseConfiguration(); Configuration config = new BaseConfiguration();
0
import java.io.UncheckedIOException; import org.apache.accumulo.fate.zookeeper.ZooReaderWriter; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @SuppressFBWarnings(value = "UNENCRYPTED_SERVER_SOCKET", justification = "not obvious what credentials could be used to set up this log receiver" + " socket in order to encrypt it, in case of errors; should probably remove this " + "socket appender in the future and force users to watch their system logs") throw new UncheckedIOException(io);
0
import org.apache.beam.sdk.transforms.Combine.BinaryCombineFn; import org.apache.beam.sdk.transforms.display.DisplayData;
0
context.setTargetHost(new HttpHost("foo.example.com"));
0
private final ConfigurationNodePointer<T> parentPointer; private final List<String> attributeNames;
0
/* public class OsgiServletHandler extends ServletHandler public void addOsgiServletHolder( String pathSpec, ServletHolder holder ) super.addServletHolder( pathSpec, holder ); public OsgiServletHolder removeOsgiServletHolder( String pathSpec ) OsgiServletHolder holder = ( OsgiServletHolder ) super.getServletHolder( pathSpec ); map.remove( pathSpec ); super._nameMap.remove( holder.getName() ); public URL getResource( String uriInContext ) Code.debug( "OSGI ServletHandler getResource:" + uriInContext ); return null; protected void dispatch( String pathInContext, HttpServletRequest request, HttpServletResponse response, ServletHolder servletHolder ) throws ServletException, UnavailableException, IOException Code.debug( "dispatch path = " + pathInContext ); super.dispatch( pathInContext, request, response, servletHolder );
0
* @see FileFilterUtils#falseFileFilter()
0
* Component Instance State : STOPPED. * The component instance is not started. */ int STOPPED = 0; /** /** * @return true if getState return 1 or 2. */ boolean isStarted();
0
/* * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/comparators/TestComparatorChain.java,v 1.7 2003/10/01 22:14:48 scolebourne Exp $ * * 3. The end-user documentation included with the redistribution, if * any, must include the following acknowledgement: * 4. The names "The Jakarta Project", "Commons", and "Apache Software * Foundation" must not be used to endorse or promote products derived * from this software without prior written permission. For written * permission, please contact apache@apache.org. * 5. Products derived from this software may not be called "Apache" * nor may "Apache" appear in their names without prior written * permission of the Apache Software Foundation. * /** * Tests for ComparatorChain. * * @version $Revision: 1.7 $ $Date: 2003/10/01 22:14:48 $ * * @author Unknown */ public class TestComparatorChain extends AbstractTestComparator { protected Comparator makeComparator() { protected List getComparableObjectsOrdered() {
0
import static org.hamcrest.Matchers.is; assertThat("Resolved file isDirectory()", file1.isDirectory(), is(false)); assertThat("Resolved file isDirectory()", file2.isDirectory(), is(false)); assertThat("Resolved file isDirectory()", file2a.isDirectory(), is(false)); assertThat("Resolved directory isDirectory()", dir1.isDirectory(), is(true)); assertThat("Resolved directory isDirectory()", dir2.isDirectory(), is(true)); assertThat("Resolved directory isDirectory()", dir2a.isDirectory(), is(true));
0
* {@inheritDoc} * {@inheritDoc} * {@inheritDoc} * {@inheritDoc}
0
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
0
* @version CVS $Id: RedirectToNodeBuilder.java,v 1.3 2003/04/29 08:25:19 sylvain Exp $
0
assertTrue(ratioFirst < 3); assertTrue(ratioFirst > 0.3);
0
* @version $Id: CompositeConfiguration.java,v 1.19 2004/10/05 22:56:58 ebourg Exp $ return new Vector(getList(key, defaultValue)); // interpolate the strings String[] tokens = new String[list.size()]; for (int i = 0; i < tokens.length; i++) { tokens[i] = interpolate(String.valueOf(list.get(i))); } return tokens;
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
@Parameter(names = {"-s", "--size"}, description = "merge goal size", converter = MemoryConverter.class) @Parameter(names = {"-f", "--force"}, description = "merge small tablets even if merging them to larger tablets might cause a split") @Parameter(names = {"-b", "--begin"}, description = "start tablet", converter = TextConverter.class) AccumuloConfiguration tableConfig = new ConfigurationCopy( conn.tableOperations().getProperties(opts.getTableName())); public void mergomatic(Connector conn, String table, Text start, Text end, long goalSize, boolean force) throws MergeException { protected long mergeMany(Connector conn, String table, List<Size> sizes, long goalSize, boolean force, boolean last) throws MergeException { // here we have the case of a merge candidate that is surrounded by candidates that would // split protected void mergeSome(Connector conn, String table, List<Size> sizes, int numToMerge) throws MergeException { protected void merge(Connector conn, String table, List<Size> sizes, int numToMerge) throws MergeException { message("Merging %d tablets from (%s to %s]", numToMerge, start == null ? "-inf" : start, end == null ? "+inf" : end); protected Iterator<Size> getSizeIterator(Connector conn, String tablename, Text start, Text end) throws MergeException {
0
private final ControlClientPool.ClientSink<? super FnApiControlClient> clientPool; ControlClientPool.ClientSink<? super FnApiControlClient> clientPool, HeaderAccessor headerAccessor) { ControlClientPool.ClientSink<? super FnApiControlClient> clientPool, HeaderAccessor headerAccessor) { } catch (Exception e) { throw new RuntimeException(e);
0
MetricsEnvironment.setCurrentContainer(null); MetricsEnvironment.setCurrentContainer(container); MetricsEnvironment.setCurrentContainer(container);
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/ri/model/dynabeans/DynaBeanPointer.java,v 1.2 2002/11/26 01:20:07 dmitri Exp $ * $Revision: 1.2 $ * $Date: 2002/11/26 01:20:07 $ import org.apache.commons.jxpath.ri.model.beans.PropertyOwnerPointer; import org.apache.commons.jxpath.ri.model.beans.PropertyPointer; * @version $Revision: 1.2 $ $Date: 2002/11/26 01:20:07 $ public Object getImmediateNode(){
0
import com.twitter.aurora.auth.CapabilityValidator.AuditCheck; return Optional.of( sessionValidator.checkAuthorized(session, Capability.ROOT, AuditCheck.REQUIRED)); context = sessionValidator.checkAuthorized(session, Capability.ROOT, AuditCheck.REQUIRED);
0
for (Entry<String,String> entry : DefaultConfiguration.getInstance())
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/RandomAccessLongList.java,v 1.2 2003/08/31 17:21:14 scolebourne Exp $ * any, must include the following acknowledgement: * Alternately, this acknowledgement may appear in the software itself, * if and wherever such third-party acknowledgements normally appear. * @version $Revision: 1.2 $ $Date: 2003/08/31 17:21:14 $
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.configuration2.tree; /** * Test class for {@code NodeHandlerDecorator}. This class uses the abstract * base class for NodeHandler tests to verify that all methods defined by the * {@code NodeHandler} interface are correctly delegated to the wrapped handler. * * @version $Id$ */ public class TestNodeHandlerDecorator extends AbstractImmutableNodeHandlerTest { /** * {@inheritDoc} This implementation returns a {@code NodeHandlerDecorator} * which wraps a {@code TreeData} object acting as the actual node handler. */ @Override protected NodeHandler<ImmutableNode> createHandler(ImmutableNode root) { final InMemoryNodeModel model = new InMemoryNodeModel(root); return new NodeHandlerDecorator<ImmutableNode>() { @Override protected NodeHandler<ImmutableNode> getDecoratedNodeHandler() { return model.getNodeHandler(); } }; } }
1
/** * @version $Id$ */ * @throws Exception if test fails * @throws Exception if test fails * @throws Exception if test fails * @throws Exception if test fails * @throws Exception if test fails
0
private static final Charset UNICODE_LITTLE_UNMARKED = Charset.forName("UnicodeLittleUnmarked");
0
if (windowingStrategy.getWindowFn().isNonMerging()
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
import org.apache.beam.sdk.transforms.OldDoFn; static class FormatResults extends OldDoFn<TableRow, String> {
0
cocoon.pushCallContext(this, redirector, avalonContext, null); context.setErrorReporter(new JSErrorReporter()); cocoon.pushCallContext(this, redirector, avalonContext, wk);
0
if (collectorHost == null) { LOG.warn("No live collector to send metrics to. Metrics to be sent will be discarded."); return false; }
0
if ((heartbeatType == null) || (heartbeatType == HeartbeatType.NONE) || (interval <= 0L)) { * @return {@code true} if heartbeat successfully sent protected boolean sendHeartBeat() { if ((heartbeatType == null) || (heartbeatType == HeartbeatType.NONE) || (interval <= 0L) || (heartBeat == null)) { return false; return true; return false; int maxChannels = this.getIntProperty(MAX_CONCURRENT_CHANNELS_PROP, DEFAULT_MAX_CHANNELS); Session session = getSession();
0
@Deprecated @Deprecated
0
import static org.easymock.EasyMock.expect; import static org.easymock.EasyMock.replay; import static org.easymock.EasyMock.reset; import static org.easymock.EasyMock.verify; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.concurrent.Executors; import junit.framework.Assert;
0
/***************************************************************************** * Copyright (C) The Apache Software Foundation. All rights reserved. * * ------------------------------------------------------------------------- * * This software is published under the terms of the Apache Software License * * version 1.1, a copy of which has been included with this distribution in * * the LICENSE file. * *****************************************************************************/ package org.apache.batik.util; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.io.IOException; import java.util.Iterator; /** * Protocol Handler for the 'jar' protocol. * This appears to have the format: * jar:<URL for jar file>!<path in jar file> * * @author <a href="mailto:deweese@apache.org">Thomas DeWeese</a> * @version $Id$ */ public class ParsedURLJarProtocolHandler extends ParsedURLDefaultProtocolHandler { public static final String JAR = "jar"; public ParsedURLJarProtocolHandler() { super(JAR); } public ParsedURLData parseURL(ParsedURL baseURL, String urlStr) { System.out.println("In parseURL"); String start = urlStr.substring(0, JAR.length()+1).toLowerCase(); if (start.equals(JAR+":")) return parseURL(urlStr); return super.parseURL(baseURL, urlStr); } }
0
public class CopletSourceFactory coplet); // nothing to do
0
* Copyright 2001-2006 The Apache Software Foundation
0
* Send a CAPA command to the POP3 server. * @return True if the command was successful, false if not. * @exception IOException If a network I/O error occurs in the process of * sending the CAPA command. ***/ public boolean capa() throws IOException { if (sendCommand(POP3Command.CAPA) == POP3Reply.OK) { getAdditionalReply(); return true; } return false; } /***
0
import org.apache.http.ssl.SSLContexts;
0
* {@code null} if no such comment has been defined. * Returns the expiration {@link Date} of the cookie, or {@code null} * @return Expiration {@link Date}, or {@code null}. * Returns {@code false} if the cookie should be discarded at the end * of the "session"; {@code true} otherwise. * @return {@code false} if the cookie should be discarded at the end * of the "session"; {@code true} otherwise * When {@code true} the cookie should only be sent * @return {@code true} if the cookie has expired.
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.server.agent; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import org.apache.ambari.server.HostNotRegisteredException; import org.apache.ambari.server.state.Host; import com.google.inject.Singleton; @Singleton public class AgentSessionManager { private static ConcurrentHashMap<String, Host> registeredHosts = new ConcurrentHashMap<>(); public void register(String sessionId, Host registeredHost) { String existKey = registeredHosts.entrySet().stream() .filter(e -> e.getValue().getHostName().equals(registeredHost.getHostName())).map(Map.Entry::getKey) .findAny().orElse(null); if (existKey != null) { registeredHosts.remove(existKey); } registeredHosts.put(sessionId, registeredHost); } public Host getHost(String sessionId) throws HostNotRegisteredException { if (registeredHosts.containsKey(sessionId)) { return registeredHosts.get(sessionId); } throw new HostNotRegisteredException(sessionId); } }
1
import org.apache.avalon.framework.activity.Disposable; import org.apache.avalon.framework.activity.Initializable; import org.apache.avalon.framework.thread.ThreadSafe; * * TODO: CacheManager expects to be a singleton. So configuring * multiple EHStore intances could lead to errors. public class EHStore extends AbstractLogEnabled implements Store, Parameterizable, Initializable, Disposable, ThreadSafe { private boolean m_overflowToDisk; m_maximumSize = parameters.getParameterAsInteger("maxobjects",100); m_overflowToDisk = parameters.getParameterAsBoolean("overflow-to-disk",true); m_cache = new Cache(m_cacheName,m_maximumSize,m_overflowToDisk,true,0,0); public void dispose() { m_cacheManager.shutdown(); m_cacheManager = null; m_cache = null; } Object value = null; final Element element = m_cache.get((Serializable) key); if (element != null) { value = element.getValue(); } if (getLogger().isDebugEnabled()) { if (value != null) { getLogger().debug("Found key: " + key); } else { getLogger().debug("NOT Found key: " + key); } } return value; if (getLogger().isDebugEnabled()) { getLogger().debug("Store object " + value + " with key "+ key); } if (getLogger().isDebugEnabled()) { getLogger().debug("Removing item " + key); } if (getLogger().isDebugEnabled()) { getLogger().debug("Clearing the store"); }
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
1
cat.debug("SignatureMethodURI = " + SignatureMethodURI); cat.debug("jceSigID = " + jceSigID);
0
import org.apache.accumulo.core.util.StringUtil; HashSet<String> nameSpacesReferenced = new HashSet<String>(); if (file.contains(":") && parts.length > 3) { List<String> base = Arrays.asList(Arrays.copyOf(parts, parts.length - 3)); nameSpacesReferenced.add(StringUtil.join(base, "/")); } for (String tableDir : nameSpacesReferenced) {
0
import org.apache.beam.vendor.guava.v20_0.com.google.common.base.Function; import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.Lists; import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.Ordering; import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.Sets; import org.apache.beam.vendor.guava.v20_0.com.google.common.hash.HashCode;
0
import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkState; import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Throwables.getStackTraceAsString; import org.apache.beam.vendor.grpc.v1p21p0.com.google.protobuf.ByteString; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.MoreObjects; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableMap;
0
Map<TServerInstance,Long> toAssign = new HashMap<>(); List<TServerInstance> tServerArray = new ArrayList<>(); Map<TServerInstance,Long> numTablets = new HashMap<>(); List<TServerInstance> underCapacityTServer = new ArrayList<>();
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 * 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
Base64.getMimeDecoder().decode("ZHVtbXkxMjM=".getBytes("UTF-8"))); Base64.getMimeDecoder().decode("ZHVtbXkxMjM=".getBytes("UTF-8"))); Base64.getMimeDecoder().decode("ZHVtbXkxMjM=".getBytes("UTF-8"))); XMLStreamWriter xmlStreamWriter = outboundXMLSec.processOutMessage(baos, "UTF-8");
0
* Filters file names for a certain name. /** The file names to search for */ * Checks to see if the file name matches. * @return true if the file name matches * Checks to see if the file name matches. * @param name the file name * @return true if the file name matches
0
private static org.slf4j.Logger log = * @param input The <code>EncryptedType</code> object to read ResourceResolver resolver = }
1
pipeline .apply(Create.of(1, 2, 3)) // This is the function that needs to propagate the input T to output T .apply("Polymorphic Identity", MapElements.via(new PolymorphicSimpleFunction<>())) // This is a consumer to ensure that all coder inference logic is executed. .apply( "Test Consumer", MapElements.via( new SimpleFunction<Iterable<Integer>, Integer>() { @Override public Integer apply(Iterable<Integer> input) { return 42; } }));
0
* @version $Revision: 1.6 $ $Date: 2004/05/16 11:16:01 $ * Evaluates the predicate returning true if the input object is of the correct type. * * @param object the input object * @return true if input is of stored type *
0
public byte[] getValue() { return value; } public K getKey() { return key; } public List<V> getValue() { return values; } public long getSize() { return size; } public K getKey() { return key; } public VA getValue() { return accumulator; } public long getSize() { return keySize + accumulatorSize; }
0
this.interrupt();
0
/* $Id$ *
0
import org.apache.ambari.server.orm.RequiresSession; @RequiresSession @RequiresSession @RequiresSession
0
private static final byte pem_array[] = new byte[256]; public void close() public int available() public int read(byte []out, int offset, int len) if ((decode_buffer[in] != '\n') &&
0
/* * Copyright 1999-2005 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. */ package org.apache.cocoon.components.validation.impl; import org.xml.sax.ErrorHandler; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; /** * <p>An implementation of the {@link ErrorHandler} interface re-throwing * all exceptions passed to it.</p> * */ public final class DraconianErrorHandler implements ErrorHandler { /** <p>The singleton instance of the {@link DraconianErrorHandler}.</p> */ public static final DraconianErrorHandler INSTANCE = new DraconianErrorHandler(); /** <p>Deny normal construction of instances of this class.</p> */ private DraconianErrorHandler() { } /** * <p>Simply re-throw the specified {@link SAXParseException}.</p> */ public void warning(SAXParseException exception) throws SAXException { throw exception; } /** * <p>Simply re-throw the specified {@link SAXParseException}.</p> */ public void error(SAXParseException exception) throws SAXException { throw exception; } /** * <p>Simply re-throw the specified {@link SAXParseException}.</p> */ public void fatalError(SAXParseException exception) throws SAXException { throw exception; } }
0
* Copyright 1999-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: PostgresEsqlQuery.java,v 1.5 2004/03/05 13:01:53 bdelacretaz Exp $
1
/* * 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.felix.sigil.eclipse.ui.internal.refactor; import org.eclipse.ltk.ui.refactoring.ChangePreviewViewerInput; import org.eclipse.ltk.ui.refactoring.IChangePreviewViewer; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; /** * @author dave * */ public class ExportChangePreviewViewer implements IChangePreviewViewer { /* (non-Javadoc) * @see org.eclipse.ltk.ui.refactoring.IChangePreviewViewer#createControl(org.eclipse.swt.widgets.Composite) */ public void createControl(Composite arg0) { // TODO Auto-generated method stub } /* (non-Javadoc) * @see org.eclipse.ltk.ui.refactoring.IChangePreviewViewer#getControl() */ public Control getControl() { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see org.eclipse.ltk.ui.refactoring.IChangePreviewViewer#setInput(org.eclipse.ltk.ui.refactoring.ChangePreviewViewerInput) */ public void setInput(ChangePreviewViewerInput input) { // TODO Auto-generated method stub } }
0
import org.eclipse.persistence.internal.helper.DatabaseField; import org.eclipse.persistence.mappings.DirectToFieldMapping; import javax.persistence.EntityTransaction; import java.sql.Clob; import java.sql.Types; rollbackTransaction(em.getTransaction()); rollbackTransaction(em.getTransaction()); DirectToFieldMapping mapping = typeBuilder.addDirectMapping(attributeName, propertyType, attributeName); // explicitly set the type of string fields if (String.class.isAssignableFrom(propertyType)) { DatabaseField field = mapping.getField(); field.setSqlType(Types.CLOB); field.setType(Clob.class); } // rollback the given transaction if it is active private static void rollbackTransaction(EntityTransaction transaction) { if (transaction != null && transaction.isActive()) { transaction.rollback(); } }
0
* Validates the given configuration entries. A valid configuration contains only valid properties * (i.e., defined or otherwise valid) that are not prefixes and whose values are formatted * correctly for their property types. A valid configuration also contains a value for property fatal(PREFIX + "improperly formatted value for key (" + key + ", type=" + prop.getType() + ") : " + value); checkTimeDuration(Property.INSTANCE_ZK_TIMEOUT, instanceZkTimeoutValue, new CheckTimeDurationBetween(1000, 300000)); log.warn("Use of " + INSTANCE_DFS_URI + " and " + INSTANCE_DFS_DIR + " are deprecated. Consider using " + Property.INSTANCE_VOLUMES + " instead."); // ACCUMULO-3651 Level changed from fatal to error and FATAL added to message for slf4j // compatibility
0
* Autogenerated by Thrift Compiler (0.11.0) @javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)")
0
import java.nio.Buffer; import org.apache.zookeeper.server.quorum.BufferStats; new Field("max_file_descriptor_count", Long.class), new Field("last_client_response_size", Integer.class), new Field("max_client_response_size", Integer.class), new Field("min_client_response_size", Integer.class)); new Field("node_count", Integer.class), new Field("client_response", BufferStats.class)); new Field("connections", Iterable.class), new Field("client_response", BufferStats.class));
1
package com.twitter.aurora.scheduler.storage.mem; import com.twitter.aurora.gen.JobKey; import com.twitter.aurora.gen.JobUpdateConfiguration; import com.twitter.aurora.scheduler.base.Tasks; import com.twitter.aurora.scheduler.storage.UpdateStore;
1
* @version CVS $Id: ValidatorActionResult.java,v 1.2 2003/03/16 17:49:11 vgritsenko Exp $
0
* http://www.apache.org/licenses/LICENSE-2.0
0
assertEquals("AvroIO.Read", AvroIO.read(String.class).from("/tmp/foo*/baz").getName()); assertEquals("AvroIO.Write", AvroIO.write(String.class).to("/tmp/foo/baz").getName()); .to("/tmp/foo/baz"); .to("/tmp/foo/baz") .to("/tmp/foo/baz") .to("/tmp/foo/baz")
0
import com.google.common.io.ByteStreams; import org.apache.beam.sdk.util.CloudObject; import org.apache.beam.sdk.util.Structs; import org.apache.beam.sdk.util.VarInt;
0
* @version $Revision$ $Date$
0
import org.apache.atlas.AtlasConstants; public final String version; this.version = AtlasConstants.DEFAULT_TYPE_VERSION; } public AbstractDataType(String name, String description, String version) { super(); this.name = name; this.description = description; this.version = version; @Override public String getVersion() { return version; }
0
* @see <A HREF="https://tools.ietf.org/html/rfc5480#section-2.2">RFC-5480 - section 2.2</A>
0
import org.apache.beam.sdk.transforms.windowing.GlobalWindow; import org.apache.beam.sdk.transforms.windowing.PaneInfo; import org.apache.beam.sdk.values.ValueInSingleWindow; List<ValueInSingleWindow<TableRow>> rows = new ArrayList<>(); rows.add(ValueInSingleWindow.of(rawRow("foo", 1234), GlobalWindow.TIMESTAMP_MAX_VALUE, GlobalWindow.INSTANCE, PaneInfo.ON_TIME_AND_ONLY_FIRING)); totalBytes = datasetService.insertAll(ref, rows, ids, InsertRetryPolicy.alwaysRetry(), null);
0
public CustomCommandDefinition getCustomCommandByName(String commandName){ for(CustomCommandDefinition ccd : getCustomCommands()){ if (ccd.getName().equals(commandName)){ return ccd; } } return null; }
0
import org.apache.beam.sdk.transforms.DoFnSchemaInformation; DoFnSchemaInformation doFnSchemaInformation; doFnSchemaInformation = ParDoTranslation.getSchemaInformation(context.getCurrentTransform()); outputCoderMap, doFnSchemaInformation); outputCoderMap, doFnSchemaInformation);
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 * <p/> * http://www.apache.org/licenses/LICENSE-2.0 * <p/> public class SecureEmbeddedServerTest extends SecureEmbeddedServerTestBase { configuration.setProperty("atlas.notification.embedded", "false");
1
UpgradeContext upgradeContext = EasyMock.createNiceMock(UpgradeContext.class); EasyMock.expect(upgradeContext.getCluster()).andReturn(cluster).anyTimes(); EasyMock.expect(upgradeContext.getType()).andReturn(UpgradeType.ROLLING).anyTimes(); EasyMock.expect(upgradeContext.getDirection()).andReturn(Direction.UPGRADE).anyTimes(); EasyMock.expect(upgradeContext.getRepositoryVersion()).andReturn(repoVersionEntity).anyTimes(); EasyMock.expect(upgradeContext.isComponentFailureAutoSkipped()).andReturn(false).anyTimes(); EasyMock.expect(upgradeContext.isServiceCheckFailureAutoSkipped()).andReturn(false).anyTimes(); replayAll(); UpgradeContext upgradeContext = EasyMock.createNiceMock(UpgradeContext.class); EasyMock.expect(upgradeContext.getCluster()).andReturn(cluster).anyTimes(); EasyMock.expect(upgradeContext.getType()).andReturn(UpgradeType.ROLLING).anyTimes(); EasyMock.expect(upgradeContext.getDirection()).andReturn(Direction.UPGRADE).anyTimes(); EasyMock.expect(upgradeContext.getRepositoryVersion()).andReturn(repoVersionEntity).anyTimes(); EasyMock.expect(upgradeContext.isComponentFailureAutoSkipped()).andReturn(true).anyTimes(); EasyMock.expect(upgradeContext.isServiceCheckFailureAutoSkipped()).andReturn(true).anyTimes(); replayAll();
0
import org.apache.accumulo.core.util.AddressUtil; int unknownHostTries = 3; log.warn("Unable to connect to HDFS", ex); } catch (IllegalArgumentException exception) { /* Unwrap the UnknownHostException so we can deal with it directly */ if (exception.getCause() instanceof UnknownHostException) { if (unknownHostTries > 0) { log.warn("Unable to connect to HDFS, will retry. cause: " + exception.getCause()); /* We need to make sure our sleep period is long enough to avoid getting a cached failure of the host lookup. */ sleep = Math.max(sleep, (AddressUtil.getAddressCacheNegativeTtl((UnknownHostException)(exception.getCause()))+1)*1000); } else { log.error("Unable to connect to HDFS and have exceeded max number of retries.", exception); throw exception; } unknownHostTries--; } else { throw exception; } log.info("Backing off due to failure; current sleep period is " + sleep / 1000. + " seconds"); /* Back off to give transient failures more time to clear. */ /* Might throw an IllegalArgumentException wrapping UnknownHostException, dealt with above. */ } catch (IllegalArgumentException exception) { /* Send IAEs back as-is, so that those that wrap UnknownHostException can be handled in the same place as similar sources of failure. */ throw exception; throw new RuntimeException("cannot find method setSafeMode", ex);
0