Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
import org.apache.commons.digester3.RulesBinder;
0
static final LongPosition END = new LongPosition(Long.MAX_VALUE); public Iterator<Entry> readFrom(Position position) throws InvalidPositionException { return jdbcTemplate.query("SELECT id, contents FROM log_stream WHERE id >= ?", public long truncateBefore(Position position) throws InvalidPositionException { return jdbcTemplate.update("DELETE FROM log_stream WHERE id < ?", to.position); return LongPosition.END;
0
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at
0
package org.apache.bcel.generic; import org.apache.bcel.ExceptionConst; super(org.apache.bcel.Const.CHECKCAST, index);
1
@Override public boolean equals(final Object object) { return object == this || decorated().equals(object); } @Override public int hashCode() { return decorated().hashCode(); }
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.rpc; import org.apache.thrift.protocol.TCompactProtocol; import org.apache.thrift.protocol.TProtocol; import org.apache.thrift.transport.TTransport; /** * {@link TCompactProtocol.Factory} implementation which injects {@link TraceProtocol} instead of {@link TCompactProtocol} */ public class TraceProtocolFactory extends TCompactProtocol.Factory { private static final long serialVersionUID = 1L; @Override public TProtocol getProtocol(TTransport trans) { return new TraceProtocol(trans); } }
0
* @version $Id$ * @since 2.2
0
* @version $Revision: 7937 $ * application instance. A service object becomes bound to the application when it
0
if (idleTime > session.maxIdleAccessTime) { session.maxIdleAccessTime = idleTime; }
0
value = Long.valueOf(l);
0
* </p>
0
* http://www.apache.org/licenses/LICENSE-2.0
0
private final ConcurrentHashMap<Integer,AuthenticationKey> allKeys = new ConcurrentHashMap<>(); Token<AuthenticationTokenIdentifier> token = new Token<>(id.getBytes(), password, id.getKind(), new Text(svcName.toString()));
0
XMLUtils.selectDsNodeText(element.getFirstChild(), Constants._TAG_HMACOUTPUTLENGTH, 0); Element HMElem =
1
/* * 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.6 $ $Date: 2004/02/18 01:12:26 $
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
package com.yahoo.zookeeper.server; public class ServerConfig { private int clientPort; private String dataDir; private String dataLogDir; protected ServerConfig(int port, String dataDir,String dataLogDir) { this.clientPort = port; this.dataDir = dataDir; this.dataLogDir=dataLogDir; } protected boolean isStandaloneServer(){ return true; } public static int getClientPort(){ assert instance!=null; return instance.clientPort; } public static String getDataDir(){ assert instance!=null; return instance.dataDir; } public static String getDataLogDir(){ assert instance!=null; return instance.dataLogDir; } public static boolean isStandalone(){ assert instance!=null; return instance.isStandaloneServer(); } protected static ServerConfig instance=null; public static void parse(String[] args) { if(instance!=null) return; if (args.length != 2) { System.err.println("USAGE: ZooKeeperServer port datadir\n"); System.exit(2); } try { instance=new ServerConfig(Integer.parseInt(args[0]),args[1],args[1]); } catch (NumberFormatException e) { System.err.println(args[0] + " is not a valid port number"); System.exit(2); } } }
0
import static org.mockito.Mockito.eq; private static Log LOG = LogFactory.getLog(BootStrapResourceTest.class);
1
import org.apache.commons.vfs2.provider.ftps.FtpsMode; builder.setFtpsMode(fileSystemOptions, FtpsMode.IMPLICIT);
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/BeanMap.java,v 1.27 2004/01/05 22:46:33 scolebourne Exp $ * @version $Revision: 1.27 $ $Date: 2004/01/05 22:46:33 $ * Puts all of the writable properties from the given BeanMap into this * parsed into the correct primitive type using, for instance,
0
Assert.assertEquals(1, VersionUtils.compareVersions("1.2.3.6.7\n", "1.2.3.4\n", 4)); //test version trimming
0
import org.apache.accumulo.test.categories.MiniClusterOnlyTest; import org.junit.experimental.categories.Category; @Category(MiniClusterOnlyTest.class)
0
return classificationType != null;
0
import java.util.Collections; * {@link com.google.cloud.dataflow.sdk.transforms.DoFn.KeyedState#lookup(java.lang.Iterable)}. private static final CodedTupleTagMap EMPTY = of(Collections.<CodedTupleTag<?>, Object>emptyMap()); * Returns an empty {@code CodedTupleTagMap}. */ public static CodedTupleTagMap empty() { return EMPTY; } /**
0
* Creates a layered file system. This method throws a 'not supported' exception. * Adds a file system to those cached by this provider. The file system * may implement {@link VfsComponent}.
0
/* * Copyright 1999-2002,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.cocoon.slop.interfaces; /** General constants for the SLOP block * * @author <a href="mailto:[email protected]">Bertrand Delacretaz</a> * @version $Id$ */ public interface SlopConstants { String SLOP_NAMESPACE_URI = "http://apache.org/cocoon/slop/parser/1.0"; // element names String SLOP_ROOT_ELEMENT = "parsed-text"; String SLOP_LINE_ELEMENT = "line"; String SLOP_EMPTY_LINE_ELEMENT = "empty-line"; // attribute names String SLOP_ATTR_LINENUMBER = "line-number"; }
0
// component configuration property whose existence causes the // activate method to fail public static final String PROP_ACTIVATE_FAILURE = "request.activation.failure"; public static SimpleComponent INSTANCE; // fail activation if requested so if ( config.containsKey( PROP_ACTIVATE_FAILURE ) ) { throw new RuntimeException( String.valueOf( config.get( PROP_ACTIVATE_FAILURE ) ) ); }
0
* @version $Id: StringDecoder.java,v 1.2 2003/07/25 22:48:11 ggregory Exp $
0
import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import org.apache.bcel.Constants;
0
while (true) { Thread.sleep(LOCATION_DELAY_SECS * 1000); // extra precaution to ensure monitor has opportunity to log
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
files.put("nested/file1kb", 1 << 10 /*1 kb*/); Files.createDirectories(filePath.getParent());
0
package org.apache.ambari.view.commons.exceptions;
0
public static Constructor lookupConstructor( Object[] parameters) {
0
import org.apache.batik.dom.anim.AnimationTarget;
0
Copyright 2002-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
public static final char[] EMPTY_CHAR_ARRAY = {}; public static int length(char[] chars) { return (chars == null) ? 0 : chars.length; } public static boolean isEmpty(char[] chars) { return length(chars) <= 0; } /** * Compares 2 character arrays - <B>Note:</B> {@code null} and empty * are considered <U>equal</U> * * @param c1 1st array * @param c2 2nd array * @return Negative is 1st array comes first in lexicographical order, * positive if 2nd array comes first and zero if equal */ public static int compare(char[] c1, char[] c2) { int l1 = length(c1); int l2 = length(c2); int cmpLen = Math.min(l1, l2); for (int index = 0; index < cmpLen; index++) { char c11 = c1[index]; char c22 = c2[index]; int nRes = Character.compare(c11, c22); if (nRes != 0) { return nRes; } } int nRes = Integer.compare(l1, l2); if (nRes != 0) { return nRes; } return 0; }
0
import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; import org.apache.ambari.server.orm.entities.ClusterConfigMappingEntity; import com.google.inject.Inject; import com.google.inject.Injector; import com.google.inject.ProvisionException; import com.google.inject.assistedinject.Assisted; import com.google.inject.assistedinject.AssistedInject; import com.google.inject.persist.Transactional; private static final Logger LOG = LoggerFactory.getLogger(ServiceImpl.class); public void addServiceComponent(ServiceComponent component) throws AmbariException { public ServiceComponent addServiceComponent( String serviceComponentName) throws AmbariException { return serviceDesiredStateEntity.getDesiredState(); + state); serviceDesiredStateEntity.setDesiredState(state); return serviceDesiredStateEntity.getSecurityState(); serviceDesiredStateEntity.setSecurityState(securityState); StackEntity desiredStackEntity = serviceDesiredStateEntity.getDesiredStack(); serviceDesiredStateEntity.setDesiredStack(stackEntity); cluster.refresh(); + ", clusterName=" + cluster.getClusterName() + ", serviceName=" + getName()); serviceDesiredStateEntity.setMaintenanceState(state); return serviceDesiredStateEntity.getMaintenanceState();
0
EvaluationContext evaluationContext) throws Exception;
0
import org.apache.sshd.common.util.SshdEventListener; public interface SignalListener extends SshdEventListener {
0
agentSessionManager.register(simpSessionId, clusters.getHost(message.getHostname())); public HeartBeatResponse heartbeat(@Header String simpSessionId, HeartBeat message) { if (!agentSessionManager.isRegistered(simpSessionId)) { //Server restarted, or unknown host. LOG.error(String.format("Host with [%s] sessionId not registered", simpSessionId)); return hh.createRegisterCommand(); } message.setHostname(agentSessionManager.getHost(simpSessionId).getHostName());
1
@Override
0
import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.apache.ambari.server.state.ComponentInfo; import org.apache.ambari.server.state.CustomCommandDefinition; /** * The names of the custom commands defined for the component. */ private List<String> customCommands; /** * Constructor. * * @param component * the component to generate the response from (not {@code null}). */ public StackServiceComponentResponse(ComponentInfo component) { componentName = component.getName(); componentCategory = component.getCategory(); isClient = component.isClient(); isMaster = component.isMaster(); cardinality = component.getCardinality(); autoDeploy = component.getAutoDeploy(); // the custom command names defined for this component List<CustomCommandDefinition> definitions = component.getCustomCommands(); if (null == definitions || definitions.size() == 0) { customCommands = Collections.emptyList(); } else { customCommands = new ArrayList<String>(definitions.size()); for (CustomCommandDefinition command : definitions) { customCommands.add(command.getName()); } } /** * Gets the names of all of the custom commands for this component. * * @return the commands or an empty list (never {@code null}). */ public List<String> getCustomCommands() { return customCommands; }
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jelly/src/java/org/apache/commons/jelly/tags/core/JellyTag.java,v 1.3 2002/04/24 11:59:13 jstrachan Exp $ * $Revision: 1.3 $ * $Date: 2002/04/24 11:59:13 $ * $Id: JellyTag.java,v 1.3 2002/04/24 11:59:13 jstrachan Exp $ import org.apache.commons.jelly.XMLOutput; * @version $Revision: 1.3 $ public void run(Context context, XMLOutput output) throws Exception { getBody().run( context, output );
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//validator/src/share/org/apache/commons/validator/FormSet.java,v 1.7 2003/04/29 02:33:17 dgraham Exp $ * $Revision: 1.7 $ * $Date: 2003/04/29 02:33:17 $ * Copyright (c) 1999-2003 The Apache Software Foundation. All rights * @version $Revision: 1.7 $ $Date: 2003/04/29 02:33:17 $ */ */ private boolean processed = false; */ */ */ private FastHashMap forms = new FastHashMap(); */ private FastHashMap constants = new FastHashMap(); */ return processed; */ */ */ */ */ */ constants.put(c.getName(), c.getValue()); */ constants.put(name, value); */ forms.put(f.getName(), f); */ return (Form) forms.get(key); */ return Collections.unmodifiableMap(forms); */ for (Iterator i = forms.values().iterator(); i.hasNext();) { Form f = (Form) i.next(); f.process(globalConstants, constants); } forms.setFast(true); constants.setFast(true); processed = true; */
0
KeyExtent extent = new KeyExtent(RootTable.ID, null, null); KeyExtent extent = new KeyExtent(MetadataTable.ID, null, null); KeyExtent extent = new KeyExtent(RootTable.ID, null, null); KeyExtent extent = new KeyExtent(MetadataTable.ID, null, null); KeyExtent extent = new KeyExtent("1", new Text("b"), new Text("a")); KeyExtent extent = new KeyExtent("1", new Text("b"), new Text("a"));
0
* $Revision: 1.8 $ * $Date: 2003/12/26 15:43:55 $ import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.List; * @author Dirk Verbeeck * @version $Revision: 1.8 $ $Date: 2003/12/26 15:43:55 $ protected void activate() throws SQLException{ _closed = false; if(_conn != null) { _conn.addTrace(this); } super.passivate(); protected void passivate() throws SQLException { _closed = true; if(_conn != null) { _conn.removeTrace(this); } // The JDBC spec requires that a statment close any open // ResultSet's when it is closed. // FIXME The PreparedStatement we're wrapping should handle this for us. // See bug 17301 for what could happen when ResultSets are closed twice. List resultSets = getTrace(); if( resultSets != null) { ResultSet[] set = (ResultSet[]) resultSets.toArray(new ResultSet[resultSets.size()]); for (int i = 0; i < set.length; i++) { set[i].close(); } clearTrace(); } super.passivate(); }
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 (c) 1999 The Apache Software Foundation. All rights * notice, this list of conditions and the following disclaimer. * if any, must include the following acknowledgment: * software without prior written permission. For written * The development of this software was partly funded by the European * Commission in the <WebSig> project in the ISIS Programme. public class XMLX509IssuerSerial extends SignatureElementProxy super(element, BaseURI, Constants._TAG_X509ISSUERSERIAL); this._constructionElement.appendChild(this._doc.createTextNode("\n")); this.getTextFromChildElement(Constants._TAG_X509SERIALNUMBER, Constants.SignatureSpecNS); .getTextFromChildElement(Constants._TAG_X509ISSUERNAME, Constants.SignatureSpecNS));
0
public ClassLoader getClassLoader(final CommandLine cl, final Shell shellState) throws AccumuloException, TableNotFoundException, AccumuloSecurityException, IOException, FileSystemException {
0
String projectType = project.getPackaging(); // ignore unsupported project types, useful when bundleplugin is configured in parent pom if ( !supportedProjectTypes.contains( projectType ) ) getLog().warn( "Ignoring project type " + projectType + " - supportedProjectTypes = " + supportedProjectTypes );
0
for (String mimeType : mimeTypes) mt.add(mimeType);
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.felix.ipojo.test.scenarios.configuration; import junit.framework.Test; import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite; import org.osgi.framework.BundleContext; public class ConfigurationTestSuite { public static Test suite(BundleContext bc) { OSGiTestSuite ots = new OSGiTestSuite("Configuration Test Suite", bc); ots.addTestSuite(SimpleProperties.class); ots.addTestSuite(DynamicallyConfigurableProperties.class); ots.addTestSuite(TestFieldProperties.class); ots.addTestSuite(TestMethodProperties.class); ots.addTestSuite(TestBothProperties.class); ots.addTestSuite(TestSuperMethodProperties.class); return ots; } }
0
* or more contributor license agreements. See the NOTICE file * regarding copyright ownership. The ASF licenses this file * with the License. You may obtain a copy of the License at * KIND, either express or implied. See the License for the
0
* This implementation only gives access to the ENGINE_SCOPE bindings. * </p> return factory == null ? SingletonHolder.DEFAULT_FACTORY : factory; } // IODH - lazy initialisation private static class SingletonHolder { private static final JexlScriptEngineFactory DEFAULT_FACTORY = new JexlScriptEngineFactory();
0
import org.apache.batik.ext.awt.image.renderable.Filter;
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: ConstraintFactory.java,v 1.4 2004/03/05 13:02:19 bdelacretaz Exp $
1
import java.io.IOException; HttpCacheEntry update(HttpCacheEntry existing) throws IOException;
0
import org.apache.beam.model.pipeline.v1.RunnerApi; try { RunnerApi.Pipeline protoPipeline = PipelineTranslation.toProto(originalPipeline); pipeline = PipelineTranslation.fromProto(protoPipeline); } catch (IOException exception) { throw new RuntimeException("Error preparing pipeline for direct execution.", exception);
0
int defSz = AbstractTiledRed.getDefaultTileSize(); // Make tile(0,0) fall on the closest intersection of defaultSz. int tgX = defSz*(int)Math.floor(bounds.x/defSz); int tgY = defSz*(int)Math.floor(bounds.y/defSz); if (tw > defSz) tw = defSz; if (th > defSz) th = defSz;
0
import org.apache.commons.configuration.event.EventListenerTestImpl; assertTrue(nsee.getMessage().contains("bogus.property")); cc.addEventListener(ConfigurationEvent.ANY, new EventListenerTestImpl(null)); .getEventListeners(ConfigurationEvent.ANY).isEmpty()); EventListenerTestImpl listener = new EventListenerTestImpl(cc); cc.addEventListener(ConfigurationEvent.ANY, listener); listener.checkEvent(ConfigurationEvent.ADD_PROPERTY, "test", "value", true); listener.checkEvent(ConfigurationEvent.ADD_PROPERTY, "test", "value", false); listener.done(); EventListenerTestImpl listener = new EventListenerTestImpl(cc); cc.addEventListener(ConfigurationEvent.ANY, listener); listener.checkEvent(ConfigurationEvent.SET_PROPERTY, "test", "value", true); listener.checkEvent(ConfigurationEvent.SET_PROPERTY, "test", "value", false); listener.done(); String key = "configuration.loaded"; .getBoolean(key)); EventListenerTestImpl listener = new EventListenerTestImpl(cc); cc.addEventListener(ConfigurationEvent.ANY, listener); cc.clearProperty(key); assertFalse("Key still present", cc.containsKey(key)); listener.checkEvent(ConfigurationEvent.CLEAR_PROPERTY, key, null, true); listener.checkEvent(ConfigurationEvent.CLEAR_PROPERTY, key, null, false); listener.done();
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jelly/src/java/org/apache/commons/jelly/parser/XMLParser.java,v 1.19 2002/05/30 14:27:07 jstrachan Exp $ * $Revision: 1.19 $ * $Date: 2002/05/30 14:27:07 $ * $Id: XMLParser.java,v 1.19 2002/05/30 14:27:07 jstrachan Exp $ * @version $Revision: 1.19 $ /** * A stack of tags used to assign the parent tag */ private List tagStack = new ArrayList(); // pop another tag onto the stack if ( parentTag != null ) { tagStack.add( parentTag ); } parentTag = tag; int size = tagStack.size(); if ( size <= 0 ) { parentTag = null; } else { parentTag = (Tag) tagStack.remove( size - 1 ); }
0
* Tests building dependencies in GLUSTERFS cluster. Uses real dependency mapping public void testInitializeAtGLUSTERFSCluster() throws AmbariException { expect(cluster.getService("GLUSTERFS")).andReturn(service); // And that some GLUSTERFS components are present (section has been loaded) expect(cluster.getService("GLUSTERFS")).andReturn(null); // Check that GLUSTERFS components are not present in dependencies assertFalse(dependenciesContainBlockedRole(deps, Role.GLUSTERFS_SERVICE_CHECK)); assertFalse(dependenciesContainBlockedRole(deps, Role.GLUSTERFS_CLIENT)); assertFalse(dependenciesContainBlockerRole(deps, Role.GLUSTERFS_SERVICE_CHECK)); assertFalse(dependenciesContainBlockerRole(deps, Role.GLUSTERFS_CLIENT)); expect(cluster.getService("GLUSTERFS")).andReturn(null); // Check that GLUSTERFS components are not present in dependencies assertFalse(dependenciesContainBlockedRole(deps, Role.GLUSTERFS_SERVICE_CHECK)); assertFalse(dependenciesContainBlockedRole(deps, Role.GLUSTERFS_CLIENT)); assertFalse(dependenciesContainBlockerRole(deps, Role.GLUSTERFS_SERVICE_CHECK)); assertFalse(dependenciesContainBlockerRole(deps, Role.GLUSTERFS_CLIENT)); expect(cluster.getService("GLUSTERFS")).andReturn(null);
0
import static org.junit.Assert.assertNull; import org.osgi.service.useradmin.Group; import org.osgi.service.useradmin.User; import org.osgi.service.useradmin.UserAdmin; UserAdmin ua = getUserAdmin(); // Create two roles... User user = (User) ua.createRole("user1", Role.USER); assertNotNull(user); Group group = (Group) ua.createRole("group1", Role.GROUP); assertNotNull(group); group.addMember(user); group.addRequiredMember(ua.getRole(Role.USER_ANYONE)); // Stop the file store; should persist the two roles... Thread.sleep(100); // Wait a little until the bundle is really stopped... // Retrieve the roles again; should both yield null due to the store not being available... user = (User) ua.getRole("user1"); assertNull(user); group = (Group) ua.getRole("group1"); assertNull(group); // This will not succeed: no backend to store the user in... assertNull(ua.createRole("user2", Role.USER)); fileStoreBundle.start(); awaitService(ORG_APACHE_FELIX_USERADMIN_FILESTORE); // Retrieve the roles again; should both yield valid values... user = (User) ua.getRole("user1"); assertNotNull(user); group = (Group) ua.getRole("group1"); assertNotNull(group); Role[] members = group.getMembers(); assertNotNull(members); assertEquals(1, members.length); assertEquals("user1", members[0].getName()); members = group.getRequiredMembers(); assertNotNull(members); assertEquals(1, members.length); assertEquals(Role.USER_ANYONE, members[0].getName()); user = (User) ua.getRole("user2"); assertNull(user);
0
NodeHandler<ImmutableNode> nodeHandler = config.getNodeModel().getNodeHandler(); config.getExpressionEngine().query(nodeHandler.getRootNode(), nodeHandler);
0
* or more contributor license agreements. See the NOTICE file * regarding copyright ownership. The ASF licenses this file * with the License. You may obtain a copy of the License at * KIND, either express or implied. See the License for the
0
SortedKeyValueIterator<Key,Value> source = getSource(); while (source.hasTop() && lastRowFound.equals(source.getTopKey().getRow())) { source.next(); // scan Key nextKey = source.getTopKey().followingKey(PartialKey.ROW); source.seek(new Range(nextKey, true, latestRange.getEndKey(), latestRange.isEndKeyInclusive()), latestColumnFamilies, latestInclusive); lastRowFound = source.hasTop() ? source.getTopKey().getRow(lastRowFound) : null;
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. */
0
import org.apache.accumulo.core.data.impl.KeyExtent;
1
import org.apache.hc.core5.util.Timeout; targetHost, outgoingRequest, Timeout.ofMinutes(1), clientContext);
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
Map<String,String> props = context.instanceOperations().getSystemConfiguration();
0
* @version $Id$
0
import java.io.File; import org.apache.accumulo.harness.AccumuloClusterIT; import org.junit.Assert; public class BulkFileIT extends AccumuloClusterIT { public void configureMiniCluster(MiniAccumuloConfigImpl cfg, Configuration conf) { FileSystem fs = getCluster().getFileSystem(); String rootPath; if (ClusterType.MINI == getClusterType()) { rootPath = new File(System.getProperty("user.dir"), "target").getCanonicalPath(); } else if (ClusterType.STANDALONE == getClusterType()) { rootPath = "/tmp"; } else { Assert.fail("Cannot compute root path for test"); return; } String dir = rootPath + "/bulk_test_diff_files_89723987592_" + getUniqueNames(1)[0];
0
return context.getZooReaderWriter().putPersistentData(zPath, value.getBytes(UTF_8), context.getZooReaderWriter().recursiveDelete(zPath, NodeMissingPolicy.FAIL);
0
import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; * @version $Revision: 1.7 $ $Date: 2004/04/09 09:43:09 $ public class TransformedMap extends AbstractMapDecorator implements Serializable { /** Serialization version */ private static final long serialVersionUID = 7023152376788900464L; //----------------------------------------------------------------------- /** * Write the map out using a custom routine. * * @param out the output stream * @throws IOException * @since Commons Collections 3.1 */ private void writeObject(ObjectOutputStream out) throws IOException { out.defaultWriteObject(); out.writeObject(map); } /** * Read the map in using a custom routine. * * @param in the input stream * @throws IOException * @throws ClassNotFoundException * @since Commons Collections 3.1 */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); map = (Map) in.readObject(); } //-----------------------------------------------------------------------
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. */
0
AccumuloClient client = getCluster().getAccumuloClient(getPrincipal(), getToken()); TableOperations tops = client.tableOperations(); AccumuloClient client = getClient(); TableOperations tops = client.tableOperations(); AccumuloClient client = getClient(); Map<String,String> nameToId = client.tableOperations().tableIdMap();
0
boolean needFullTextrocessor() { boolean needClassificationProcessor() { return classificationType != null && (entityType == null || hasAttributeFilter(searchParameters.getTagFilters())); boolean needEntityProcessor() {
0
import java.util.Random; Random random = new Random(); UtilWaitThread.sleep(100 + random.nextInt(100)); // sleep randomly between 100 and 200 ms UtilWaitThread.sleep(100 + random.nextInt(100)); // sleep randomly between 100 and 200 ms
0
// A default host name for batch traffic. private static final String DEFAULT_HOST = "https://batch-spanner.googleapis.com/"; abstract String getHost(); @Nullable return builder().setHost(DEFAULT_HOST).build(); abstract Builder setHost(String host); public SpannerConfig withHost(String host) { return toBuilder().setHost(host).build(); } if (getHost() != null) { builder.setHost(getHost()); }
0
import org.apache.beam.runners.core.GroupAlsoByWindowsAggregators; GroupAlsoByWindowsAggregators.DROPPED_DUE_TO_CLOSED_WINDOW_COUNTER); GroupAlsoByWindowsAggregators.DROPPED_DUE_TO_LATENESS_COUNTER);
0
import org.apache.hc.core5.http.io.HttpClientResponseHandler; * relieving individual {@link HttpClientResponseHandler}s from having to manage * @param HttpClientResponseHandler the response handler final HttpClientResponseHandler<? extends T> HttpClientResponseHandler) throws IOException { return execute(request, HttpClientResponseHandler, null); * relieving individual {@link HttpClientResponseHandler}s from having to manage * @param HttpClientResponseHandler the response handler final HttpClientResponseHandler<? extends T> HttpClientResponseHandler, final HttpContext context) return execute(target, request, HttpClientResponseHandler, context); * relieving individual {@link HttpClientResponseHandler}s from having to manage * @param HttpClientResponseHandler the response handler final HttpClientResponseHandler<? extends T> HttpClientResponseHandler) throws IOException { return execute(target, request, HttpClientResponseHandler, null); * relieving individual {@link HttpClientResponseHandler}s from having to manage * @param HttpClientResponseHandler the response handler final HttpClientResponseHandler<? extends T> HttpClientResponseHandler, final HttpContext context) throws IOException { Args.notNull(HttpClientResponseHandler, "Response handler"); final T result = HttpClientResponseHandler.handleResponse(response);
0
final InstructionList il = new InstructionList(); final MethodGen method = new MethodGen(Const.ACC_PUBLIC, Type.VOID, Type.NO_ARGS, new String[] { }, "<init>", final InstructionHandle ih_0 = il.append(InstructionFactory.createLoad(Type.OBJECT, 0)); final InstructionHandle ih_4 = il.append(InstructionFactory.createReturn(Type.VOID)); final InstructionList il = new InstructionList(); final MethodGen method = new MethodGen(Const.ACC_PUBLIC | Const.ACC_STATIC, Type.VOID, new Type[] { Type.OBJECT }, final InstructionHandle ih_0 = il.append(new PUSH(_cp, 1)); final InstructionHandle ih_5 = il.append(new PUSH(_cp, 1)); final InstructionHandle ih_7 = il.append(InstructionFactory.createLoad(Type.OBJECT, 1)); final InstructionHandle ih_11 = il.append(InstructionFactory.createReturn(Type.VOID));
1
import org.apache.beam.sdk.extensions.sql.RowSqlType; import org.apache.beam.sdk.values.Row; import org.apache.beam.sdk.values.RowType; static RowType inputRowType; static List<Row> inputRows; RowSqlType
0
* @version CVS $Id: LoopTagSupport.java,v 1.4 2003/12/23 15:28:33 joerg Exp $ * @see #next()
0
import org.apache.atlas.GraphTransactionInterceptor; GraphTransactionInterceptor.lockObjectAndReleasePostCommit(guid); GraphTransactionInterceptor.lockObjectAndReleasePostCommit(guid); GraphTransactionInterceptor.lockObjectAndReleasePostCommit(guids); GraphTransactionInterceptor.lockObjectAndReleasePostCommit(guid);
0
package cz.seznam.euphoria.core.client.operator.state; import cz.seznam.euphoria.core.client.functional.BinaryFunction; /** * Optional interface for descriptor to implement in order to enable state merging. */ public interface MergingStorageDescriptor<T> { /** * Retrieve the merging function for state storages. */ BinaryFunction<? extends Storage<T>, ? extends Storage<T>, Void> getMerger(); }
0
ambariProperties.setProperty(Configuration.LDAP_USER_SEARCH_FILTER.getKey(), "17"); ambariProperties.setProperty(Configuration.LDAP_ALT_USER_SEARCH_ENABLED.getKey(), "true"); ambariProperties.setProperty(Configuration.LDAP_ALT_USER_SEARCH_FILTER.getKey(), "18"); Assert.assertEquals("17", ldapProperties.getUserSearchFilter(false)); Assert.assertEquals(true, ldapProperties.isAlternateUserSearchFilterEnabled()); Assert.assertEquals("18", ldapProperties.getUserSearchFilter(true));
0
import com.google.common.collect.Iterables; UncommittedBundle<T> bundle = context.createBundle( (PCollection<T>) Iterables.getOnlyElement(application.getOutputs()).getValue());
0
break;
0
import javax.inject.Inject;
1
* * * * * * * * *
0
import com.google.cloud.dataflow.sdk.util.common.worker.NativeReader; public static NativeReader.Progress cloudProgressToReaderProgress( public static NativeReader.Position cloudPositionToReaderPosition( @Nullable Position cloudPosition) { @Nullable NativeReader.Progress readerProgress) { public static Position toCloudPosition(@Nullable NativeReader.Position readerPosition) { @Nullable NativeReader.DynamicSplitRequest splitRequest) { public static NativeReader.DynamicSplitRequest toDynamicSplitRequest( static class DataflowReaderProgress implements NativeReader.Progress { static class DataflowReaderPosition implements NativeReader.Position { private static class DataflowDynamicSplitRequest implements NativeReader.DynamicSplitRequest {
0
public void testBlockExtend1() throws Exception { pipeTest("ext/test", "test3/test.xml"); } public void testBlockExtend2() throws Exception { pipeTest("ext/test2", "test2/test.xml"); } public void testBlockExtend3() throws Exception { pipeTest("ext/test3", "test3/test.xml"); } public void testBlockExtend4() throws Exception { pipeTest("ext/test3", "test1/test.xml"); }
0
builder.addEventListener(Event.ANY, l1); builder.addEventListener(ConfigurationEvent.ANY, l2);
0
return new RootedFileSystemProvider().newFileSystem(dir, Collections.emptyMap());
0
try (AccumuloClient c = Accumulo.newClient().from(getClientProps()).build()) {
0
import java.util.Arrays; else if (value.getClass().isArray()) { return Arrays.asList((Object[]) value); }
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jelly/src/java/org/apache/commons/jelly/tags/define/Attic/DynamicTag.java,v 1.10 2002/07/10 21:46:18 jvanzyl Exp $ * $Revision: 1.10 $ * $Date: 2002/07/10 21:46:18 $ * $Id: DynamicTag.java,v 1.10 2002/07/10 21:46:18 jvanzyl Exp $ * @version $Revision: 1.10 $
0