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 * * 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.events; public class MessageNotDelivered extends AmbariEvent { private final Long hostId; public MessageNotDelivered(Long hostId) { super(AmbariEventType.MESSAGE_NOT_DELIVERED); this.hostId = hostId; } public Long getHostId() { return hostId; } }
0
/** * Returns a String descriptor entry parameter value. */ long getLong(Params key); /** * Returns a String descriptor entry parameter value. */ long getLong(Params key, long def);
0
import org.apache.felix.ipojo.composite.CompositeInstanceDescription; CompositeInstanceDescription id = (CompositeInstanceDescription) arch.getInstanceDescription(); //id = arch.getInstanceDescription(); //id = arch.getInstanceDescription(); //id = arch.getInstanceDescription(); //id = arch.getInstanceDescription();
0
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; * @deprecated (4.2) use {@link PoolingHttpClientConnectionManager} if (hca.getPoolEntry() != null) { Asserts.check(hca.getManager() == this, "Connection not obtained from this manager"); }
0
import java.awt.Rectangle; public CachableRed getSource() { Rectangle aoiR; if (aoi != null) aoiR = aoi.getBounds(); else aoiR = getBounds2D().getBounds(); CachableRed cr = getSource(); if (aoiR.intersects(cr.getBounds()) == false) return null; aoiR = aoiR.intersection(cr.getBounds()); // Get the device bounds, we will crop the affine to those // bounds. Rectangle devAOI = at.createTransformedShape(aoiR).getBounds(); return new AffineRed(cr, at, rh);
0
import org.apache.felix.framework.util.Util; import org.osgi.framework.AdminPermission; import org.osgi.framework.Bundle; if (!"felix".equals(url.getAuthority())) { checkPermission(url); } protected void parseURL(URL u, String spec, int start, int limit) { super.parseURL(u, spec, start, limit); if (checkPermission(u)) { super.setURL(u, u.getProtocol(), u.getHost(), u.getPort(), "felix", u.getUserInfo(), u.getPath(), u.getQuery(), u.getRef()); } } private boolean checkPermission(URL u) { SecurityManager sm = System.getSecurityManager(); if (sm != null) { Object framework = m_framework; if (framework == null) { framework = URLHandlers.getFrameworkFromContext(); if (!(framework instanceof Felix)) { return false; } } Felix felix = (Felix) framework; long bundleId = Util.getBundleIdFromModuleId(u.getHost()); Bundle bundle = felix.getBundle(bundleId); if (bundle != null) { sm.checkPermission(new AdminPermission(bundle, AdminPermission.RESOURCE)); return true; } } else { return true; } return false; }
1
@Override public BeamSqlPrimitive evaluate(Row inputRow, BoundedWindow window) {
0
package org.apache.commons.digester3; /* * 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
return iface.isAssignableFrom(getClass()) || _stmt.isWrapperFor(iface); } else if (iface.isAssignableFrom(_stmt.getClass())) { return iface.cast(_stmt); return _stmt.unwrap(iface);
0
import org.apache.accumulo.server.security.SystemCredentials; MasterMonitorInfo stats = client.getMasterStats(Tracer.traceInfo(), SystemCredentials.get().getAsThrift()); static class Opts extends ClientOnRequiredTable {}
1
for (int i=0; i<list.getLength(); i++) { Node n = list.item(i); if (n != null) {
0
* Copyright 2001-2006 The Apache Software Foundation
0
//client = new HttpClient(new ThreadLocalHttpConnectionManager()); final HostConfiguration config = new HostConfiguration();
0
* <pre> * </pre> * <pre> * </pre> * <pre> * </pre>
0
/** * 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.aurora.common.testing; import java.util.concurrent.atomic.AtomicBoolean; import com.google.common.testing.junit4.TearDownTestCase; import org.junit.Test; import org.apache.aurora.common.base.Command; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; /** * @author John Sirois */ public class TearDownRegistryTest extends TearDownTestCase { @Test public void testTearDown() { TearDownRegistry tearDownRegistry = new TearDownRegistry(this); final AtomicBoolean actionExecuted = new AtomicBoolean(false); tearDownRegistry.addAction(new Command() { @Override public void execute() { actionExecuted.set(true); } }); assertFalse(actionExecuted.get()); tearDown(); assertTrue(actionExecuted.get()); } }
0
import java.nio.file.Path; import java.nio.file.Paths; private Path currentDir; this.currentDir = Paths.get(System.getProperty("user.dir")).toAbsolutePath().normalize(); public Path currentDir() { return currentDir; } public void currentDir(Path path) { currentDir = path; } if (target instanceof Path) { return target.toString(); }
0
import static org.apache.beam.vendor.guava.v20_0.com.google.common.base.Preconditions.checkState; import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.Iterables;
0
import org.apache.http.HttpHost;
0
fac = XMLSignatureFactory.getInstance("DOM", new org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI());
0
import com.google.inject.Binder; import org.apache.atlas.listener.EntityChangeListener; import org.apache.atlas.repository.audit.EntityAuditListener; import org.apache.atlas.repository.audit.EntityAuditRepository; import org.apache.atlas.repository.audit.HBaseBasedAuditRepository; import org.apache.atlas.service.Service; import org.apache.atlas.typesystem.types.TypeSystemProvider; bind(TypeSystem.class).toProvider(TypeSystemProvider.class).in(Singleton.class); bindAuditRepository(binder()); //Add EntityAuditListener as EntityChangeListener Multibinder<EntityChangeListener> entityChangeListenerBinder = Multibinder.newSetBinder(binder(), EntityChangeListener.class); entityChangeListenerBinder.addBinding().to(EntityAuditListener.class); protected void bindAuditRepository(Binder binder) { //Map EntityAuditRepository interface to hbase based implementation binder.bind(EntityAuditRepository.class).to(HBaseBasedAuditRepository.class).asEagerSingleton(); //Add HBaseBasedAuditRepository to service so that connection is closed at shutdown Multibinder<Service> serviceBinder = Multibinder.newSetBinder(binder(), Service.class); serviceBinder.addBinding().to(HBaseBasedAuditRepository.class); }
0
@SerializedName("clusterSize") private int clusterSize = -1; public void setClusterSize(int clusterSize) { this.clusterSize = clusterSize; }
0
* Signals a malformed chunked stream.
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
/*** * $Id: POP3Reply.java,v 1.1 2002/04/03 01:04:33 brekke Exp $ * * NetComponents Internet Protocol Library * Copyright (C) 1997-2002 Daniel F. Savarese * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library in the LICENSE file; if not, write * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA ***/ package com.oroinc.net.pop3; import java.io.*; import java.net.*; import java.util.*; /*** * POP3Reply stores POP3 reply code constants. * <p> * <p> * @author Daniel F. Savarese ***/ public final class POP3Reply { /*** The reply code indicating success of an operation. ***/ public static int OK = 0; /*** The reply code indicating failure of an operation. ***/ public static int ERROR = 1; // Cannot be instantiated. private POP3Reply() {} }
0
return new ChainedTransformer<>(transformers); return new ChainedTransformer<>(false, cmds);
1
String base = System.getProperty("basedir") == null ? "./": System.getProperty("basedir"); base += fs + "data"
0
import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; state.set("tableList", new CopyOnWriteArrayList<String>()); List<String> tables = (List<String>) state.get("tableList");
0
import org.apache.http.params.HttpConnectionParams; .setIntParameter(HttpConnectionParams.SO_TIMEOUT, 5000) .setBooleanParameter(HttpConnectionParams.STALE_CONNECTION_CHECK, false)
0
package cz.seznam.euphoria.core.client.functional; /** * Function of two arguments of the same type. */ @FunctionalInterface public interface SameArgsBinaryFunction<IN, OUT> extends BinaryFunction<IN, IN, OUT> { }
0
/* * Copyright 2016-2018 Seznam.cz, a.s.
0
for (byte[] val : values)
0
public boolean isPrimitiveType() { return isNumericType() || isStringType() || isDateType(); } // For MAP type, returns the type of the key element, it must be a primitive type; @Nullable public abstract TypeName getMapKeyType(); // For MAP type, returns the type of the value element, it can be a nested type; @Nullable public abstract FieldType getMapValueType(); abstract Builder setMapKeyType(@Nullable TypeName mapKeyType); abstract Builder setMapValueType(@Nullable FieldType mapValueType); public FieldType withMapType(@Nullable TypeName mapKeyType, @Nullable FieldType mapValueType) { if (mapKeyType != null && mapValueType != null) { checkArgument(mapKeyType.isPrimitiveType()); return toBuilder().setMapKeyType(mapKeyType) .setMapValueType(mapValueType).build(); && Objects.equals(getMapKeyType(), other.getMapKeyType()) && Objects.equals(getMapValueType(), other.getMapValueType()) getMapKeyType(), getMapValueType(), getRowSchema(), getMetadata() });
0
private static BCELComparator _cmp = new BCELComparator() { * @param comparator Comparison strategy object */ public static void setComparator( BCELComparator comparator ) { _cmp = comparator; } /**
0
import org.apache.accumulo.core.data.TableId; KeyExtent ke = new KeyExtent(TableId.of("0"), null, null); KeyExtent ke = new KeyExtent(TableId.of("0"), null, null); KeyExtent ke = new KeyExtent(TableId.of("0"), null, null);
0
FunctionSpec.newBuilder() .setUrn(KNOWN_CODER_URNS.get(coder.getClass())) .setPayload(ByteString.copyFrom(translator.getPayload(coder)))) FunctionSpec.newBuilder() .setUrn(JAVA_SERIALIZED_CODER_URN) .setPayload(ByteString.copyFrom(SerializableUtils.serializeToByteArray(coder))) .build()) String coderSpecUrn = protoCoder.getSpec().getUrn(); String coderUrn = coder.getSpec().getUrn(); return translator.fromComponents(coderComponents, coder.getSpec().getPayload().toByteArray()); protoCoder.getSpec().getPayload().toByteArray(), "Custom Coder Bytes");
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/decorators/Attic/ObservedTestHelper.java,v 1.3 2003/08/31 21:09:49 scolebourne Exp $ * @version $Revision: 1.3 $ $Date: 2003/08/31 21:09:49 $ coll.addModificationListener(new Object());
0
for (int j = 0; j < 10; ++j) {
0
import java.util.function.Predicate; /** * @since 4.4 */ @Override public boolean removeIf(final Predicate<? super E> filter) { return decorated().removeIf(filter); }
0
import org.apache.beam.vendor.grpc.v1p21p0.com.google.protobuf.Struct; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.util.concurrent.ListeningExecutorService;
0
package org.apache.felix.sigil.eclipse.ui.internal.preferences.repository;
0
Map<String, Object> properties = new HashMap<String, Object>(); Map<String, Object> properties = new HashMap<String, Object>(); Map<String, Object> properties = new HashMap<String, Object>();
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.dom; import org.apache.batik.dom.events.NodeEventTarget; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.w3c.dom.events.EventTarget; /** * This interface provides an access to the non DOM methods implemented by * all the nodes in this implementation. * * @author <a href="mailto:[email protected]">Stephane Hillion</a> * @version $Id$ */ public interface ExtendedNode extends EventTarget, NodeEventTarget { /** * Sets the name of this node. */ void setNodeName(String v); /** * Tests whether this node is readonly. */ boolean isReadonly(); /** * Sets this node readonly attribute. */ void setReadonly(boolean v); /** * Sets the parent node. */ void setParentNode(Node v); /** * Sets the node immediately preceding this node. */ void setPreviousSibling(Node n); /** * Sets the node immediately following this node. */ void setNextSibling(Node n); /** * Sets the value of the specified attribute. This method only applies * to Attr objects. */ void setSpecified(boolean v); }
1
* Copyright 2001-2005 The Apache Software Foundation
0
JavaClass clazz = getTestClass(PACKAGE_BASE_NAME+".data.PLSETestClass"); JavaClass clazz = getTestClass(PACKAGE_BASE_NAME+".data.PLSETestClass");
0
package org.apache.beam.harness.channel; import org.hamcrest.Matchers; assertThat(socketAddress, Matchers.instanceOf(InetSocketAddress.class)); assertThat(socketAddress, Matchers.instanceOf(DomainSocketAddress.class));
0
import org.apache.hc.core5.http.ClassicHttpResponse; import org.apache.hc.core5.http.io.entity.BasicHttpEntity; import org.apache.hc.core5.http.io.entity.HttpEntityWithTrailers; import org.apache.hc.core5.http.io.entity.StringEntity; import org.apache.hc.core5.http.message.BasicHeader; public void testResponseConnControlEntityUnknownContentLengthExplicitKeepAlive() throws Exception { Assert.assertEquals("keep-alive", header.getValue()); Assert.assertNotNull(h1); Assert.assertEquals("chunked", h1.getValue());
1
package org.apache.hadoop.metadata.service; import java.io.IOException; public class TestService implements Service { public static final String NAME = TestService.class.getName(); @Override public String getName() { return NAME; } @Override public void start() throws Exception { } @Override public void stop() { } @Override public void close() throws IOException { } }
0
@SuppressWarnings("unchecked") // (1) should only fail if input stream is incorrect map = (Map<K, Object>) in.readObject(); // (1)
0
ClientContext context = getClientContext();
0
if (__state != __LAST_WAS_CR_STATE) { } if (__state == __LAST_WAS_NL_STATE) { } while (length-- > 0) { } if (__output == null) { } if (__state == __LAST_WAS_CR_STATE) { } else if (__state != __LAST_WAS_NL_STATE) { }
1
* Interface for receiving data. * Unlike {@link java.io.InputStream}, this interface is tailored * to the needs of the HTTP components. *
0
out.println("-w <width> Width of the output image"); out.println("-h <height> Height of the output image"); float width = Float.NaN; float height = Float.NaN; } else if (args[i].equals("-w")) { if (i+1 < args.length) { i++; try{ width = Float.parseFloat(args[i++]); }catch(NumberFormatException e){ usage(System.err); System.exit(1); } continue; } else { error("option -w requires an argument"); usage(System.err); System.exit(1); } } else if (args[i].equals("-h")) { if (i+1 < args.length) { i++; try{ width = Float.parseFloat(args[i++]); }catch(NumberFormatException e){ usage(System.err); System.exit(1); } continue; } else { error("option -h requires an argument"); usage(System.err); System.exit(1); } if(!Float.isNaN(width)){ t.addTranscodingHint(ImageTranscoder.KEY_WIDTH, new Float(width)); } if(!Float.isNaN(height)){ t.addTranscodingHint(ImageTranscoder.KEY_HEIGHT, new Float(height)); }
0
BatchScanner scanner = conn.createBatchScanner(state.getString("seqTableName"), new Authorizations(), 2);
0
import static org.apache.beam.vendor.guava.v20_0.com.google.common.base.Preconditions.checkArgument; import static org.apache.beam.vendor.guava.v20_0.com.google.common.base.Preconditions.checkNotNull; import static org.apache.beam.vendor.guava.v20_0.com.google.common.base.Preconditions.checkState; import org.apache.beam.vendor.guava.v20_0.com.google.common.annotations.VisibleForTesting; import org.apache.beam.vendor.guava.v20_0.com.google.common.base.MoreObjects; import org.apache.beam.vendor.guava.v20_0.com.google.common.base.Optional; import org.apache.beam.vendor.guava.v20_0.com.google.common.base.Preconditions; import org.apache.beam.vendor.guava.v20_0.com.google.common.base.Throwables; import org.apache.beam.vendor.guava.v20_0.com.google.common.cache.Cache; import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableList; import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableSortedMap; import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.Ordering; import org.apache.beam.vendor.guava.v20_0.com.google.common.io.ByteStreams; import org.apache.beam.vendor.guava.v20_0.com.google.common.primitives.Ints; import org.apache.beam.vendor.guava.v20_0.com.google.common.primitives.Longs;
0
import org.apache.hc.core5.http.nio.SessionOutputBuffer; import org.apache.hc.core5.http.nio.SessionOutputBufferImpl;
1
final int map_length = input.readUnsignedShort(); for (final StackMapEntry entry : map) { for (final StackMapEntry element : map) { final StringBuilder buf = new StringBuilder("StackMap("); final StackMap c = (StackMap) clone();
1
/** * The MIME types that jacl can handle. */ private static final String[] JACL_MIMETYPES = { "text/tcl" }; * Returns the mime-types to register this interpereter with. public String[] getMimeTypes() { return JACL_MIMETYPES; }
0
* Service with one or more Http Service registrations. * Specification this property is set to a collection of {@code service.id} * for the {@code HttpService} registrations provided by this * implementation. * The value of this attribute must be of type {@code Collection<Long>}.
0
import java.io.IOException; import java.io.InputStream; InputStream getContent() throws IOException;
0
String connString = (String) event.getOldValue(); a.firePropertyChangedEvent(Plugin.NEW_NODE_READY, connString, mbsc);
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.bootstrap; import java.util.LinkedHashMap; import java.util.Map; /** * Only Store the most recent 100 Key Value Pairs. * */ @SuppressWarnings("serial") public class FifoLinkedHashMap<K, V> extends LinkedHashMap<K, V> { public static final int MAX_ENTRIES = 100; protected boolean removeEldestEntry(Map.Entry<K, V> eldest) { return size() > MAX_ENTRIES; } }
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
OutputReceiverFactory outputReceiverFactory, StateRequestHandler stateRequestHandler, BundleProgressHandler progressHandler) return processor.newBundle(outputReceivers.build(), stateRequestHandler, progressHandler);
0
protected K setKey(final K key) { protected V setValue(final V value) {
0
if (!shellState.getConnector().tableOperations().exists(tableName)) throw new TableNotFoundException(null, tableName, null); if (cl.hasOption(optStartRow.getOpt())) startRow = new Text(cl.getOptionValue(optStartRow.getOpt())); if (cl.hasOption(optEndRow.getOpt())) endRow = new Text(cl.getOptionValue(optEndRow.getOpt()));
1
import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import org.apache.bcel.Constants;
0
package com.twitter.mesos.scheduler.httphandlers;
0
verify(mockStorage).removeEntry("http://foo.example.com:80/content");
0
* @deprecated Use {@link #getSha1Digest()} @Deprecated
0
import org.apache.ambari.server.stack.StackManagerFactory; install(new FactoryModuleBuilder().build(StackManagerFactory.class));
0
@FunctionalInterface
0
public Converting copy() { // TODO Implement this return null; } @Override
0
return isConstant(this instanceof JexlNode.Literal<?>); } public boolean isConstant(boolean literal) { if (literal) {
0
String timer1Tag = "gAAAAAAAA-joB_____8P"; String timer2Tag = "gAAAAAAAA-joBwA"; String timer3Tag = timer2Tag + "AAAA"; String bufferTag = "MergeWindows:gAAAAAAAA-joBw/__buffer"; String watermarkHoldTag = "MergeWindows:gAAAAAAAA-joBw/__watermark_hold";
0
@Deprecated @Override ColumnUpdate upd = (ColumnUpdate) obj; return Arrays.equals(getColumnFamily(), upd.getColumnFamily()) && Arrays.equals(getColumnQualifier(), upd.getColumnQualifier()) && Arrays.equals(getColumnVisibility(), upd.getColumnVisibility()) && isDeleted() == upd.isDeleted() && Arrays.equals(getValue(), upd.getValue()) && hasTimestamp() == upd.hasTimestamp() && getTimestamp() == upd.getTimestamp(); @Override public int hashCode() { return Arrays.hashCode(columnFamily) + Arrays.hashCode(columnQualifier) + Arrays.hashCode(columnVisibility) + (hasTimestamp ? (Boolean.TRUE.hashCode() + new Long(timestamp).hashCode()) : Boolean.FALSE.hashCode()) + (deleted ? Boolean.TRUE.hashCode() : (Boolean.FALSE.hashCode() + Arrays.hashCode(val))); }
0
this(opt, null, hasArg, description);
0
import org.apache.beam.vendor.grpc.v1p13p1.io.grpc.stub.CallStreamObserver; import org.apache.beam.vendor.grpc.v1p13p1.io.grpc.stub.StreamObserver;
0
import org.apache.ambari.common.rest.entities.NodeRole; NodeRole ns = new NodeRole(e.getRoleName(), NodeRole.NODE_SERVER_STATE_DOWN, Util.getXMLGregorianCalendar(new Date())); nodes.getNodes().get(host).getNodeState().updateRoleState(ns); if (nodes.getNodes().get(host).getNodeState().getNodeRoles() == null) { NodeRole ns = new NodeRole(getDefaultRoleName(cid), NodeRole.NODE_SERVER_STATE_DOWN, Util.getXMLGregorianCalendar(new Date()) ); nodes.getNodes().get(host).getNodeState().updateRoleState(ns); return nodes.getNodes().get(hostname).getNodeState().getNodeRoleNames(null); if (n.getNodeState().getNodeRoleNames("") == null) { continue; } if (!n.getNodeState().getNodeRoleNames("").contains(roleName)) {
0
* @return <code>true</code> if the encodings of these strings are identical, <code>false</code> otherwise.
1
import javax.annotation.Nullable; @Default.Long(10 * 60) @Nullable Long getTestTimeoutSeconds(); void setTestTimeoutSeconds(Long value);
0
List<String> names = schmreg.getSchemeNames();
0
/* ==================================================================== * Copyright (c) 2001-2004 The Apache Software Foundation. All rights * @version $Revision: 1.2 $ $Date: 2004/01/14 21:34:28 $
0
@Test public void testDefaultMap() { Integer value = new DefaultMap<String,Integer>(0).get("test"); assertNotNull(value); assertEquals(new Integer(0), value); value = new DefaultMap<String,Integer>(1).get("test"); assertNotNull(value); assertEquals(new Integer(1), value); AtomicInteger canConstruct = new DefaultMap<String,AtomicInteger>(new AtomicInteger(1)).get("test"); assertNotNull(canConstruct); assertEquals(new AtomicInteger(0).get(), canConstruct.get()); DefaultMap<String,String> map = new DefaultMap<String,String>(""); assertEquals(map.get("foo"), ""); map.put("foo", "bar"); assertEquals(map.get("foo"), "bar"); }
1
private static final long serialVersionUID = 8305393337889433901L;
0
package org.apache.cocoon.portal.om;
0
public class Main<OptionT extends NexmarkOptions> { void runAll(OptionT options, NexmarkLauncher nexmarkLauncher) { NexmarkPerf perf = nexmarkLauncher.run(configuration); NexmarkLauncher<NexmarkOptions> nexmarkLauncher = new NexmarkLauncher<>(options); new Main<>().runAll(options, nexmarkLauncher);
0
import org.apache.aurora.scheduler.storage.entities.IJobUpdateKey; * @param key ID of the update associated with the event. void insert(@Param("key") IJobUpdateKey key, @Param("event") JobUpdateEvent event);
0
import org.objectweb.asm.Label; final MethodDescriptor md = new MethodDescriptor("$init", desc, (access & ACC_STATIC) == ACC_STATIC); return new MethodInfoCollector(md); final MethodDescriptor md = new MethodDescriptor(name, desc, (access & ACC_STATIC) == ACC_STATIC); return new MethodInfoCollector(md); * It also collects local variables definition. private final class MethodInfoCollector extends EmptyVisitor { private MethodInfoCollector(MethodDescriptor md) { public void visitLocalVariable(String name, String desc, String signature, Label start, Label end, int index) { m_method.addLocalVariable(name, desc, signature, index); } public void visitEnd() { m_method.end(); }
0
public void flushCacheEntriesInvalidatedByRequest( public void flushCacheEntriesInvalidatedByExchange(
0
import org.apache.ambari.view.huetoambarimigration.datasource.queryset.huequeryset.pig.savedscriptqueryset.QuerySetHueDb; import java.net.URI; static final Logger logger = Logger.getLogger(PigScriptMigrationImplementation.class); public ArrayList<PigModel> fetchFromHueDatabase(String username, String startdate, String endtime, Connection connection, QuerySetHueDb huedatabase) throws ClassNotFoundException, IOException { int ownerId; String ownerName=""; ownerId = rs1.getInt("user_id"); if(username.equals("all")) { prSt = huedatabase.getUserName(connection, ownerId); ResultSet resultSet = prSt.executeQuery(); while(resultSet.next()) { ownerName = resultSet.getString("username"); } } pojopig.setUserName(ownerName); URI uri = new URI(dir); FileSystem fs = FileSystem.get(uri, conf, username); URI uri = new URI(dir); FileSystem fs = FileSystem.get(uri, conf, username); fileSystem.setOwner(path, username, "hadoop"); fileSystem.setOwner(path, username, "hadoop");
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
public int hashCode() { return 0; } @Override public int hashCode() { return 0; } @Override
0
// use the EOF flag of the underlying codec instance return baseNCodec.eof ? 0 : 1; if (!baseNCodec.hasData()) { baseNCodec.encode(buf, 0, c); baseNCodec.decode(buf, 0, c); readLen = baseNCodec.readResults(b, offset, len);
0
* @version $Revision$ $Date$
0
private static final Logger LOG = LoggerFactory.getLogger(ExecutableStageDoFnOperator.class); LOG.debug(String.format("Sending value: %s", element));
0
import org.apache.beam.sdk.testing.ValidatesRunner; @Category(ValidatesRunner.class)
0
import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkState; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList;
0
* Return whether decimals are allowed in the number. * * @return Whether decimals are allowed in the number */ public boolean isAllowDecimals() { return allowDecimals; } /** * Return the number format pattern used to convert * Numbers to/from a <code>java.lang.String</code> * (or <code>null</code> if none specified). * <p> * See <code>java.text.SimpleDateFormat</code> for details * of how to specify the pattern. * * @return The format pattern. */ public String getPattern() { return pattern; } /** * Return the Locale for the <i>Converter</i> * (or <code>null</code> if none specified). * * @return The locale to use for conversion */ public Locale getLocale() { return locale; } /** * @param locale The locale to use for conversion
0
import org.apache.commons.collections4.functors.EqualPredicate; import org.apache.commons.collections4.functors.InstanceofPredicate; import org.apache.commons.collections4.functors.NotPredicate; import org.apache.commons.collections4.functors.NullPredicate;
0
private void ensureIsDirectory(Source src, String location) throws ConfigurationException { if (!src.exists()) { throw new ConfigurationException(src.getURI() + " doesn't exist, at " + location); } else if (!(src instanceof TraversableSource) || !((TraversableSource)src).isCollection()) { throw new ConfigurationException(src.getURI() + " is not a directory, at " + location); } } ensureIsDirectory(src, child.getLocation()); ensureIsDirectory(src, child.getLocation()); Iterator iter = ((TraversableSource)src).getChildren().iterator(); while (iter.hasNext()) { Source childSrc = (Source)iter.next(); String childURI = childSrc.getURI(); resolver.release(childSrc); if (childURI.endsWith(".jar") || childURI.endsWith(".zip")) { urlList.add(new URL(childURI));
0