Diff
stringlengths 5
2k
| FaultInducingLabel
int64 0
1
|
---|---|
newLoader(ruleModule).setClassLoader(d.getClassLoader()).decorate(d); | 0 |
import org.apache.cocoon.environment.Request;
* @version CVS $Id: PortalServiceImpl.java,v 1.12 2004/07/11 14:04:34 cziegeler Exp $
final Request request = ContextHelper.getRequest( this.context );
PortalServiceInfo info = (PortalServiceInfo) request.getAttribute(this.key, Request.GLOBAL_SCOPE);
request.setAttribute(this.key, info, Request.GLOBAL_SCOPE); | 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 $Id: PoolableConnection.java,v 1.12 2004/02/28 11:48:05 dirkv Exp $ | 0 |
package org.apache.beam.sdk.testing;
import static org.apache.beam.sdk.testing.SerializableMatchers.allOf;
import static org.apache.beam.sdk.testing.SerializableMatchers.anything;
import static org.apache.beam.sdk.testing.SerializableMatchers.containsInAnyOrder;
import static org.apache.beam.sdk.testing.SerializableMatchers.kvWithKey;
import static org.apache.beam.sdk.testing.SerializableMatchers.not;
import org.apache.beam.sdk.coders.AtomicCoder;
import org.apache.beam.sdk.coders.Coder;
import org.apache.beam.sdk.util.SerializableUtils;
import org.apache.beam.sdk.values.KV;
| 0 |
* Copyright (C) 2015 Google Inc. | 0 |
return new DelegateCoder<>(coder, toFn, fromFn, typeDescriptor); | 0 |
import org.apache.batik.util.DoublyIndexedTable; | 0 |
* </p>
* </p>
* </p> | 0 |
"nodeRangeExpressions", | 0 |
import net.jcip.annotations.Immutable;
@Immutable | 0 |
params.setParameter(CoreConnectionPNames.SO_TIMEOUT, 100);
params.setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 100); | 0 |
import org.apache.ambari.server.orm.entities.RepositoryVersionEntity;
import org.apache.ambari.server.state.repository.ClusterVersionSummary;
import org.apache.ambari.server.state.repository.VersionDefinitionXml;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
@Mock
private ClusterVersionSummary m_clusterVersionSummary;
@Mock
private VersionDefinitionXml m_vdfXml;
@Mock
private RepositoryVersionEntity m_repositoryVersion;
final Map<String, Service> m_services = new HashMap<>();
public void setup() throws Exception {
m_services.clear();
Mockito.when(m_repositoryVersion.getRepositoryXml()).thenReturn(m_vdfXml);
Mockito.when(m_vdfXml.getClusterSummary(Mockito.any(Cluster.class))).thenReturn(m_clusterVersionSummary);
Mockito.when(m_clusterVersionSummary.getAvailableServiceNames()).thenReturn(m_services.keySet());
m_services.put("TEZ", service);
Mockito.when(cluster.getServices()).thenReturn(m_services);
PrereqCheckRequest request = new PrereqCheckRequest("cluster");
request.setTargetRepositoryVersion(m_repositoryVersion);
Assert.assertTrue(servicesTezDistributedCacheCheck.isApplicable(request));
req.setTargetRepositoryVersion(m_repositoryVersion);
m_services.remove("TEZ");
Assert.assertFalse(servicesTezDistributedCacheCheck.isApplicable(request)); | 0 |
close(true); | 0 |
@Override
@Override | 0 |
AccumuloConfiguration acuconf =
FileOutputConfigurator.getAccumuloConfiguration(AccumuloFileOutputFormat.class, job); | 0 |
package org.apache.aurora.scheduler.thrift;
import com.twitter.thrift.Status;
| 0 |
import org.apache.cocoon.portal.services.CopletFactory;
import org.apache.cocoon.portal.services.LayoutFactory;
import org.apache.cocoon.portal.services.LinkService; | 0 |
super(new HashMap<>()); | 0 |
return new UnmodifiableOrderedMap<>(map); | 1 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/PredicateUtils.java,v 1.13 2003/11/23 19:11:21 scolebourne Exp $
import org.apache.commons.collections.functors.EqualPredicate;
import org.apache.commons.collections.functors.FalsePredicate;
import org.apache.commons.collections.functors.IdentityPredicate;
import org.apache.commons.collections.functors.InstanceofPredicate;
import org.apache.commons.collections.functors.NotNullPredicate;
import org.apache.commons.collections.functors.NotPredicate;
import org.apache.commons.collections.functors.NullIsExceptionPredicate;
import org.apache.commons.collections.functors.NullIsFalsePredicate;
import org.apache.commons.collections.functors.NullIsTruePredicate;
import org.apache.commons.collections.functors.NullPredicate;
import org.apache.commons.collections.functors.TruePredicate;
* @version $Revision: 1.13 $ $Date: 2003/11/23 19:11:21 $
return TruePredicate.INSTANCE;
return FalsePredicate.INSTANCE;
return NullPredicate.INSTANCE;
return NotNullPredicate.INSTANCE;
return EqualPredicate.getInstance(value);
return IdentityPredicate.getInstance(value);
return InstanceofPredicate.getInstance(type);
return NotPredicate.getInstance(predicate);
return NullIsExceptionPredicate.getInstance(predicate);
return NullIsFalsePredicate.getInstance(predicate);
return NullIsTruePredicate.getInstance(predicate); | 0 |
if (!getCombinedState().isAcceptingInputs())
return;
if (!getCombinedState().isAcceptingInputs())
return true;
| 0 |
import javax.persistence.Lob;
@Column(name = "inputs")
@Lob
private byte[] inputs = new byte[0];
return inputs != null ? new String(inputs) : null;
this.inputs = inputs != null ? inputs.getBytes() : null; | 0 |
// If nodefilters are set, must execute them first to create node-set
try {
return Collections.unmodifiableSet(xi.getNodeSet()).iterator();
} catch (Exception e) {
// should not occur
throw new RuntimeException
("unrecoverable error retrieving nodeset", e);
} | 1 |
Map<String, DesiredConfig> clusterDesired = (cluster == null) ? new HashMap<String, DesiredConfig>() : cluster.getDesiredConfigs(); | 0 |
* @version $Revision$ $Date$ | 0 |
import org.apache.felix.sigil.eclipse.ui.SigilUI; | 0 |
import org.apache.cocoon.portal.layout.aspect.TabLayoutStatus;
* @version CVS $Id: TabContentAspect.java,v 1.2 2003/05/08 13:38:11 cziegeler Exp $ | 0 |
/*
* Copyright 2001-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 $Revision: 1.3 $ $Date: 2004/02/18 00:59:20 $ | 0 |
package org.w3c.dom.svg;
import org.w3c.dom.DOMException;
public interface SVGURIReference {
public String getXlinkType( );
public void setXlinkType( String xlinkType )
throws DOMException;
public String getXlinkRole( );
public void setXlinkRole( String xlinkRole )
throws DOMException;
public String getXlinkArcRole( );
public void setXlinkArcRole( String xlinkArcRole )
throws DOMException;
public String getXlinkTitle( );
public void setXlinkTitle( String xlinkTitle )
throws DOMException;
public String getXlinkShow( );
public void setXlinkShow( String xlinkShow )
throws DOMException;
public String getXlinkActuate( );
public void setXlinkActuate( String xlinkActuate )
throws DOMException;
public SVGAnimatedString getHref( );
} | 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.logsearch.conf.global;
import javax.inject.Named;
@Named
public class LogSearchConfigState {
private volatile boolean logSearchConfigAvailable;
public boolean isLogSearchConfigAvailable() {
return logSearchConfigAvailable;
}
public void setLogSearchConfigAvailable(boolean logSearchConfigAvailable) {
this.logSearchConfigAvailable = logSearchConfigAvailable;
}
} | 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.
*/
/**
* Euphoria to Beam translation package.
*/
package cz.seznam.euphoria.beam; | 0 |
/*
* Copyright 2000-2009 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 |
* @version $Revision$ | 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 |
* this pool at the same time, or non-positive for no limit.
* in perUserMaxConnections.
* this pool at the same time, or non-positive for no limit.
* in perUserMaxConnections. The default is 8.
* pool, without extra ones being released, or negative for no limit.
* in perUserMaxIdle.
* pool, without extra ones being released, or negative for no limit.
* in perUserMaxIdle. The default is 8.
* this pool at the same time, or non-positive for no limit.
* this pool at the same time, or non-positive for no limit.
* pool, without extra ones being released, or negative for no limit.
* pool, without extra ones being released, or negative for no limit. | 0 |
package org.apache.accumulo.core.cryptoImpl; | 0 |
Set<String> hostsToForceKerberosOperations = new HashSet<String>();
if(Service.Type.KERBEROS.name().equalsIgnoreCase(scHost.getServiceName()) &&
Role.KERBEROS_CLIENT.name().equalsIgnoreCase(scHost.getServiceComponentName())) {
// Since the KERBEROS/KERBEROS_CLIENT is about to be moved from the INIT to the
// INSTALLED state (and it should be by the time the stages (in this request)
// that need to be execute), collect the relevant hostname to make sure the
// Kerberos logic doest not skip operations for it.
hostsToForceKerberosOperations.add(scHost.getHostName());
}
kerberosHelper.ensureIdentities(cluster, serviceFilter, null, hostsToForceKerberosOperations, requestStages); | 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 |
/*
* Copyright 2002, 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.
*/
package org.apache.commons.vfs.provider.bzip2;
import org.apache.commons.vfs.FileName;
import org.apache.commons.vfs.FileObject;
import org.apache.commons.vfs.FileSystemException;
import org.apache.commons.vfs.FileSystemOptions;
import org.apache.commons.vfs.provider.compressed.CompressedFileFileSystem;
import java.util.Collection;
/**
* Filesytem to handle compressed files using the bzip2 method
*
* @author <a href="mailto:[email protected]">Mario Ivankovits</a>
* @version $Revision: 1.1 $ $Date: 2004/06/16 18:19:05 $
*/
public class Bzip2FileSystem extends CompressedFileFileSystem
{
public Bzip2FileSystem(FileName rootName, FileObject parentLayer, FileSystemOptions fileSystemOptions) throws FileSystemException
{
super(rootName, parentLayer, fileSystemOptions);
}
protected FileObject createFile(FileName name) throws FileSystemException
{
return new Bzip2FileObject(name, getParentLayer(), this);
}
protected void addCapabilities(final Collection caps)
{
caps.addAll(Bzip2FileProvider.capabilities);
}
} | 0 |
import java.util.Collection;
public void init(ClientSession session, String service, Collection<?> identities) throws Exception { | 0 |
import java.io.IOException;
import java.io.Reader;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Vector; | 0 |
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.transaction.Synchronization;
import org.apache.commons.dbcp2.DelegatingConnection;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
* Tests ManagedDataSource with an active transaction in progress.
@Test
public void testGetConnectionInAfterCompletion() throws Exception {
final DelegatingConnection<?> connection = (DelegatingConnection<?>) newConnection();
// Don't close so we can check it for warnings in afterCompletion
transactionManager.getTransaction().registerSynchronization(new Synchronization() {
@Override
public void beforeCompletion() {
// empty
}
@Override
public void afterCompletion(int i) {
try {
Connection connection1 = ds.getConnection();
try {
connection1.getWarnings();
fail("Could operate on closed connection");
} catch (SQLException e) {
// This is expected
}
} catch (SQLException e) {
fail("Should have been able to get connection");
}
}
});
connection.close();
transactionManager.commit();
}
| 0 |
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import org.junit.Test;
public class DemuxTestCase {
@Test
@Test | 0 |
Copyright 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 |
* Copyright 2016 Seznam.cz, a.s. | 0 |
KeyPairGenerator kpg = KeyPairGenerator.getInstance("DSA");
kpg.initialize(1024);
KeyPair keyPair = kpg.generateKeyPair(); | 0 |
package org.apache.aurora.scheduler.storage.mem;
import org.apache.aurora.gen.Lock;
import org.apache.aurora.gen.LockKey;
import org.apache.aurora.scheduler.base.JobKeys;
import org.apache.aurora.scheduler.storage.LockStore;
import org.apache.aurora.scheduler.storage.entities.ILock;
import org.apache.aurora.scheduler.storage.entities.ILockKey;
| 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//digester/src/java/org/apache/commons/digester/Substitutor.java,v 1.3 2004/01/10 17:39:41 rdonkin Exp $
* $Revision: 1.3 $
* $Date: 2004/01/10 17:39:41 $
* Copyright (c) 2001-2004 The Apache Software Foundation. All rights
* @version $Revision: 1.3 $ $Date: 2004/01/10 17:39:41 $ | 0 |
* <p>
* <p>
import org.apache.atlas.repository.Constants;
import org.apache.commons.collections.CollectionUtils;
final String type = searchFilter.getParam(SearchFilter.PARAM_TYPE);
final String name = searchFilter.getParam(SearchFilter.PARAM_NAME);
final String supertype = searchFilter.getParam(SearchFilter.PARAM_SUPERTYPE);
final String notSupertype = searchFilter.getParam(SearchFilter.PARAM_NOT_SUPERTYPE);
final List<String> notNames = searchFilter.getParams(SearchFilter.PARAM_NOT_NAME);
// Add filter for the type negation
if (CollectionUtils.isNotEmpty(notNames)) {
for (String notName : notNames) {
predicates.add(new NotPredicate(getNamePredicate(notName)));
}
}
return (isClassificationType(o) && ((AtlasClassificationType) o).getAllSuperTypes().contains(supertype)) ||
(isEntityType(o) && ((AtlasEntityType) o).getAllSuperTypes().contains(supertype));
AtlasType atlasType = (AtlasType) o;
public static void addParamsToHideInternalType(SearchFilter searchFilter) {
searchFilter.setParam(SearchFilter.PARAM_NOT_NAME, Constants.TYPE_NAME_INTERNAL);
searchFilter.setParam(SearchFilter.PARAM_NOT_SUPERTYPE, Constants.TYPE_NAME_INTERNAL);
} | 0 |
import org.apache.beam.sdk.transforms.SerializableFunction;
PCollection<OutputT> output;
input.apply(
ParDo.of(
new DoFn<InputT, OutputT>() {
@ProcessElement
public void processElement(@Element Row row, OutputReceiver<OutputT> o) {
// Read the row, potentially unboxing if necessary.
Object input = unbox ? row.getValue(0) : row;
// The output has a schema, so we need to convert to the appropriate type.
o.output(
converted.outputSchemaCoder.getFromRowFunction().apply((Row) input));
}
}));
output =
SerializableFunction<?, OutputT> convertPrimitive =
ConvertHelpers.getConvertPrimitive(converted.unboxedType, outputTypeDescriptor);
output =
input.apply(
ParDo.of(
new DoFn<InputT, OutputT>() {
@ProcessElement
public void processElement(@Element Row row, OutputReceiver<OutputT> o) {
o.output(convertPrimitive.apply(row.getValue(0)));
}
}));
output.setTypeDescriptor(outputTypeDescriptor);
// TODO: Support boxing in Convert (e.g. Long -> Row with Schema { Long }). | 0 |
for (Clazz c: list) {
break;
definition.sortReferences(); | 0 |
import org.apache.accumulo.server.util.PortUtils;
proxyPort = PortUtils.getRandomFreePort(); | 0 |
* Abstract non-blocking client-side HTTP connection interface. It can be used
* to submit HTTP requests and asynchronously receive HTTP responses.
*
* @see NHttpConnection
*
* @version $Revision$
* Submits {@link HttpRequest} to be sent to the target server.
* Returns <code>true</code> if an HTTP request has been submitted to the
* @return <code>true</code> if an HTTP request has been submitted,
* <code>false</code> otherwise. | 0 |
* @version CVS $Id: RepeaterJXPathBinding.java,v 1.22 2004/03/03 12:30:18 antonio Exp $
if (uniqueBindings != null) {
for (int i=0; i < uniqueBindings.length; i++) {
uniqueRowBinding.add(uniqueBindings[i]);
} | 0 |
import org.apache.beam.sdk.values.WindowingStrategy; | 0 |
* @version $Revision$ | 0 |
return new TestSuite(Jira349TestCase.class); | 0 |
import java.io.File;
else if (source instanceof File) {
return getSAXReader().read((File) source);
} | 0 |
// TODO: FRAGMENT RESOLVER - Technically, this is only necessary for fragments.
// When we refactoring for the new R4.3 framework API, we'll have to see
// if this is still necessary, since the new BundleWirings API will give
// us another way to detect it.
boolean isRemovalPending(); | 0 |
* @version $Id$ | 0 |
import org.apache.sshd.common.NamedResource;
public boolean canExtractKeyPairs(NamedResource resourceKey, List<String> lines)
SessionContext session, NamedResource resourceKey, FilePasswordProvider passwordProvider, List<String> lines)
NamedResource resourceKey, List<String> lines, int startIndex, String hdrName, String hdrValue, List<String> curLines)
SessionContext session, NamedResource resourceKey,
SessionContext session, NamedResource resourceKey,
public Collection<KeyPair> loadKeyPairs(NamedResource resourceKey, byte[] pubData, byte[] prvData)
public Collection<KeyPair> loadKeyPairs(NamedResource resourceKey, InputStream pubData, InputStream prvData)
public abstract Collection<KeyPair> loadKeyPairs(NamedResource resourceKey, PuttyKeyReader pubReader, PuttyKeyReader prvReader) | 0 |
* <p>
* </p>
* <p>
* </p>
* <p>
* </p>
* <p>
* </p>
* <p>
* </p>
* <p>
* </p> | 0 |
* Copyright 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. | 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 | 0 |
List<String> txids = new ArrayList<>();
LinkedHashMap<String,TxOpts> txOpts = new LinkedHashMap<>(2);
AdminUtil<Master> admin = new AdminUtil<>();
ZooStore<Master> zs = new ZooStore<>(path, zk);
admin.print(new ReadOnlyStore<>(zs), zk, ZooUtil.getRoot(instance) + Constants.ZTABLE_LOCKS); | 1 |
import org.apache.commons.digester3.Rule;
import org.apache.commons.digester3.binder.NestedPropertiesBuilder;
extends Rule
public void begin( String namespace, String name, Attributes attributes )
NestedPropertiesBuilder builder = getDigester().peek();
builder.addAlias( elementName ).forProperty( propertyName ); | 0 |
import org.apache.atlas.AtlasException;
void setNull(String attrName) throws AtlasException;
boolean getBoolean(String attrName) throws AtlasException;
byte getByte(String attrName) throws AtlasException;
short getShort(String attrName) throws AtlasException;
int getInt(String attrName) throws AtlasException;
long getLong(String attrName) throws AtlasException;
float getFloat(String attrName) throws AtlasException;
double getDouble(String attrName) throws AtlasException;
BigInteger getBigInt(String attrName) throws AtlasException;
BigDecimal getBigDecimal(String attrName) throws AtlasException;
Date getDate(String attrName) throws AtlasException;
String getString(String attrName) throws AtlasException;
void setBoolean(String attrName, boolean val) throws AtlasException;
void setByte(String attrName, byte val) throws AtlasException;
void setShort(String attrName, short val) throws AtlasException;
void setInt(String attrName, int val) throws AtlasException;
void setLong(String attrName, long val) throws AtlasException;
void setFloat(String attrName, float val) throws AtlasException;
void setDouble(String attrName, double val) throws AtlasException;
void setBigInt(String attrName, BigInteger val) throws AtlasException;
void setBigDecimal(String attrName, BigDecimal val) throws AtlasException;
void setDate(String attrName, Date val) throws AtlasException;
void setString(String attrName, String val) throws AtlasException; | 0 |
inputs.put(new TupleTag<KV<Long, String>>("mainInputName") {}, mainInput);
assertThat(ParDoTranslation.getMainInputName(protoTransform), equalTo("mainInputName")); | 0 |
* @exception IllegalArgumentException value is not | 1 |
import org.junit.Test;
public class NullWriterTest {
@Test | 0 |
try {
encoder.encode(null);
} catch( EncoderException ee ) {
// An exception should be thrown
} | 0 |
/* $Id: DigesterRulesSource.java,v 1.9 2004/05/10 06:30:08 skitching Exp $
* | 0 |
private static final int BUFFER_SIZE = 2048;
throw new IllegalStateException("Inconsistent codec state");
// read and discard the remainder of the message
byte buffer[] = new byte[BUFFER_SIZE];
while (read(buffer) >= 0) {
} | 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 $Id: ValidationRuleBuilder.java,v 1.3 2004/03/05 13:02:28 bdelacretaz Exp $ | 1 |
* Manages an internal list of secret keys used to sign new authentication tokens as they are
* generated, and to validate existing tokens used for authentication.
* Each TabletServer, in addition to the Master, has an instance of this {@link SecretManager} so
* that each can authenticate requests from clients presenting delegation tokens. The Master will
* also run an instance of {@link AuthenticationTokenKeyManager} which handles generation of new
* keys and removal of old keys. That class will call the methods here to ensure the in-memory cache
* is consistent with what is advertised in ZooKeeper.
log.trace("Overriding token expiration date from {} to {}", identifier.getExpirationDate(),
requestedExpirationDate);
public Entry<Token<AuthenticationTokenIdentifier>,AuthenticationTokenIdentifier> generateToken(
String username, DelegationTokenConfig cfg) throws AccumuloException {
// Create password will update the state on the identifier given currentKey. Need to call this
// before serializing the identifier
Token<AuthenticationTokenIdentifier> token = new Token<>(id.getBytes(), password, id.getKind(),
new Text(svcName.toString()));
* Removes the {@link AuthenticationKey} from the local cache of keys using the provided
* {@code keyId}.
* Inspect each key cached in {@link #allKeys} and remove it if the expiration date has passed.
* For each removed local {@link AuthenticationKey}, the key is also removed from ZooKeeper using
* the provided {@code keyDistributor} instance.
// Method in the parent is a different package, provide the explicit override so we can use it
// directly in our package. | 0 |
// Commenting this out since we do not need an index for edge here
//createEdgeMixedIndex(propertyName);
/* Commenting this out since we do not need an index for edge label here
} */ | 0 |
public void testEmptyIfNull() {
assertTrue(ListUtils.emptyIfNull(null).isEmpty());
List<Long> list = new ArrayList<Long>();
assertSame(list, ListUtils.emptyIfNull(list));
}
| 0 |
import com.google.cloud.dataflow.sdk.util.state.MergingStateContext;
import com.google.cloud.dataflow.sdk.util.state.StateContext;
public abstract StateContext<K> state();
public abstract MergingStateContext<K, W> state();
public abstract void onMerge(OnMergeContext context) throws Exception;
public abstract void onTrigger(OnTriggerContext context) throws Exception;
public void prefetchOnMerge(MergingStateContext<K, W> c) throws Exception {}
* @param context Context to use prefetch from.
public void prefetchOnTrigger(StateContext<K> context) {}
public abstract void clearState(Context context) throws Exception;
public abstract StateContents<Boolean> isEmpty(StateContext<K> context); | 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.hc.core5.annotation.Contract;
import org.apache.hc.core5.annotation.ThreadingBehavior;
@Contract(threading = ThreadingBehavior.IMMUTABLE)
final String method = request.getMethod().toUpperCase(Locale.ROOT); | 0 |
import org.apache.accumulo.core.client.impl.AcceptableThriftTableOperationException;
throw new AcceptableThriftTableOperationException(tableId, null, TableOperation.COMPACT, TableOperationExceptionType.OTHER, "Compaction canceled");
throw new AcceptableThriftTableOperationException(tableId, null, TableOperation.COMPACT, TableOperationExceptionType.NOTFOUND, null);
throw new AcceptableThriftTableOperationException(tableId, null, TableOperation.COMPACT, TableOperationExceptionType.OFFLINE, null); | 0 |
private boolean enabled = true;
/**
* Gets whether this definition is enabled.
*
* @return {@code true} if enabled.
*/
@JsonProperty("enabled")
public boolean isEnabled() {
return enabled;
}
/**
* Sets whether this definition is enabled.
*
* @param enabled
* {@code true} if enabled.
*/
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
response.setEnabled(entity.getEnabled()); | 0 |
protected static final int ui(byte b)
protected static final long ul(byte b) | 0 |
Copyright 2000-2001 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 |
* @version CVS $Id$
XMLUtils.createElement(contenthandler, "title", copletInstanceData.getTitle()); | 0 |
private static final String TIMESTAMP_ATTRIBUTE = "timestamp";
private static final String ID_ATTRIBUTE = "id";
client = new PubsubJsonClient(TIMESTAMP_ATTRIBUTE, ID_ATTRIBUTE, mockPubsub);
ImmutableMap.of(TIMESTAMP_ATTRIBUTE, String.valueOf(MESSAGE_TIME),
ID_ATTRIBUTE, RECORD_ID));
.put(TIMESTAMP_ATTRIBUTE, String.valueOf(MESSAGE_TIME))
.put(ID_ATTRIBUTE, RECORD_ID) | 0 |
/*
* Copyright 2006 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.felix.upnp.tester;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
/**
* @author Stefano "Kismet" Lenzi
* @author Francesco Furfari
*
*/
public class Activator implements BundleActivator {
public static BundleContext context;
private ControlPoint cp;
/**
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
Activator.context = context;
cp = new ControlPoint();
}
/**
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
cp.close();
Activator.context=null;
}
} | 0 |
private static final NoTservers NO_SERVERS = new NoTservers(log);
protected final OutstandingMigrations outstandingMigrations = new OutstandingMigrations(log);
resetBalancerErrors();
} else {
outstandingMigrations.migrations = migrations;
constraintNotMet(outstandingMigrations);
} else {
constraintNotMet(NO_SERVERS); | 0 |
&& ref.getField().getDeclaringClass().getName().equals(container.getClassDescription().getDescribedClass().getName())
this.logger.debug("Generating bind and unbind method for " + name + " in " + container.getClassDescription().getDescribedClass().getName());
this.logger.debug("Generating bind method for " + name + " in " + container.getClassDescription().getDescribedClass().getName());
this.logger.debug("Generating unbind method for " + name + " in " + container.getClassDescription().getDescribedClass().getName()); | 0 |
import org.apache.zookeeper.ZKTestCase;
import org.junit.Assert;
import org.junit.Test;
public class PurgeTxnTest extends ZKTestCase implements Watcher {
@Test
Assert.assertTrue("waiting for server being up ",
Assert.assertTrue("waiting for server to shutdown",
Assert.assertTrue("exactly 3 snapshots ", (numSnaps == 3)); | 0 |
@Override
public void setUp() throws Exception {
// ensure jul logging is only error to avoid warning in silent mode
java.util.logging.Logger.getLogger(JexlEngine.class.getName()).setLevel(java.util.logging.Level.SEVERE);
}
@SuppressWarnings("boxing") | 0 |
*
* @version $Id: AggregateFieldDefinition.java,v 1.6 2004/02/11 10:43:30 antonio Exp $ | 0 |
this.requester = new HttpAsyncRequester(this.httpProcessor, this.reuseStrategy); | 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.thrift;
import org.apache.thrift.TException;
/**
* @author Adam Samet
*
* This is exception is thrown when accessing a thrift service resource times out.
*/
public class TTimeoutException extends TException {
private static final long serialVersionUID = 1L;
public TTimeoutException(String message) {
super(message);
}
public TTimeoutException(Throwable cause) {
super(cause);
}
public TTimeoutException(String message, Throwable cause) {
super(message, cause);
}
} | 0 |
import org.apache.directory.api.util.Strings;
import org.apache.hadoop.security.authentication.util.KerberosName;
import org.apache.hadoop.security.authentication.util.KerberosUtil;
import sun.security.krb5.KrbException;
public static final String HADOOP_SECURITY_AUTH_TO_LOCAL = "hadoop.security.auth_to_local";
public static final String CORE_SITE = "core-site";
public static final String HDFS_AUTH_TO_LOCAL = "hdfs.auth_to_local";
String shortName = getLoggedinUser();
try {
String authToLocalRules = getAuthToLocalRules();
//Getting ambari server realm. Ideally this should come from user
String defaultRealm = KerberosUtil.getDefaultRealm();
if(Strings.isNotEmpty(authToLocalRules) && Strings.isNotEmpty(defaultRealm)){
synchronized (KerberosName.class){
KerberosName.setRules(authToLocalRules);
shortName = new KerberosName(shortName+"@"+defaultRealm).getShortName();
}
}
} catch (Exception e) {
LOG.error("Failed to get username",e);
}
return shortName;
}
private String getAuthToLocalRules(){
Cluster cluster = getCluster();
String authToLocalRules = null;
if (cluster != null) {
authToLocalRules = cluster.getConfigurationValue(CORE_SITE, HADOOP_SECURITY_AUTH_TO_LOCAL);
}else if(viewInstanceEntity != null) {
authToLocalRules = viewInstanceEntity.getPropertyMap().get(HDFS_AUTH_TO_LOCAL);
}
return authToLocalRules;
}
@Override
public String getLoggedinUser(){
context.put("loggedinUser",
new ParameterResolver() {
@Override
protected String getValue() {
return viewContext.getLoggedinUser();
}
}); | 0 |
import org.apache.accumulo.core.data.impl.KeyExtent; | 1 |
import org.apache.beam.sdk.testing.CoderProperties; | 0 |
* {@link org.apache.ambari.server.state.RepositoryVersionState#UPGRADING}.
* Retrieve all of the host versions for the given host name across all clusters.
public List<HostVersionEntity> findByHost(String hostName) {
.createNamedQuery("hostVersionByHostname", HostVersionEntity.class);
* Retrieve all of the host versions for the given cluster name and host name.
* @param clusterName Cluster name
public List<HostVersionEntity> findByClusterAndHost(String clusterName, String hostName) {
.createNamedQuery("hostVersionByClusterAndHostname", HostVersionEntity.class);
query.setParameter("clusterName", clusterName); | 0 |
* @version $Id: EventAwareCacheImpl.java,v 1.3 2003/07/20 21:08:06 ghoward Exp $
if (!m_eventRegistry.wasRecoverySuccessful()) { | 0 |
requestContext.setAttemptCount(numRetries + 1);
requestContext.setMaxAttempts(maxRetries);
| 0 |