Diff stringlengths 5 2k | FaultInducingLabel int64 0 1 |
|---|---|
public <R,P> R accept(NodeVisitor<? extends R, ? super P> visitor, P data)
{
return visitor.visit(this, data);
} | 0 |
@Override | 0 |
synchQ = new ArrayBlockingQueue<>(1); | 1 |
ProtocolVersion getProtocolVersion(); | 0 |
throw new RuntimeException(e.getCause()); | 0 |
public final transient TestPipeline testPipeline = TestPipeline.create(); | 0 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/ | 0 |
import org.apache.commons.collections.Transformer;
public class BeanMap extends AbstractMap<Object, Object> implements Cloneable {
@SuppressWarnings("unchecked")
// The set actually contains strings; however, because it cannot be
// modified there is no danger in selling it as Set<Object>
public Set<Object> keySet() {
public Set<Map.Entry<Object, Object>> entrySet() {
return Collections.unmodifiableSet(new AbstractSet<Map.Entry<Object, Object>>() {
public Iterator<Map.Entry<Object, Object>> iterator() {
public Collection<Object> values() {
ArrayList<Object> answer = new ArrayList<Object>( readMethods.size() );
for ( Iterator<Object> iter = valueIterator(); iter.hasNext(); ) {
return Collections.unmodifiableList(answer);
public Class<?> getType(String name) {
public Iterator<String> keyIterator() {
public Iterator<Object> valueIterator() {
final Iterator<?> iter = keyIterator();
return new Iterator<Object>() {
public Iterator<Map.Entry<Object, Object>> entryIterator() {
final Iterator<String> iter = keyIterator();
return new Iterator<Map.Entry<Object, Object>>() {
public Map.Entry<Object, Object> next() {
@SuppressWarnings("unchecked")
// This should not cause any problems; the key is actually a
// string, but it does no harm to expose it as Object
Map.Entry<Object, Object> tmpEntry = new Entry( BeanMap.this, key, value );
return tmpEntry;
protected Object convertType( Class<?> newType, Object value )
protected Transformer getTypeTransformer( Class<?> aType ) { | 0 |
/**
* Encodes a {@link ServiceInstance} as a JSON object.
*/
public class JsonCodec implements Codec<ServiceInstance> {
/**
* The encoding for service instance data in ZooKeeper expected by Aurora clients.
*/
public static final Codec<ServiceInstance> INSTANCE = new JsonCodec();
private JsonCodec() { | 0 |
final ArrayList<E> copyOfList1 = new ArrayList<E>(list1);
if (copyOfList1.contains(e)) {
copyOfList1.remove(e); | 0 |
import org.apache.commons.bcel6.Const;
super(Const.T_UNKNOWN, "Long_Upper"); | 0 |
return getAttributeNS(null, SVG_GLYPH_REF_ATTRIBUTE);
setAttributeNS(null, SVG_GLYPH_REF_ATTRIBUTE, glyphRef);
return getAttributeNS(null, SVG_FORMAT_ATTRIBUTE);
setAttributeNS(null, SVG_FORMAT_ATTRIBUTE, format);
return Float.parseFloat(getAttributeNS(null, SVG_X_ATTRIBUTE));
setAttributeNS(null, SVG_X_ATTRIBUTE, String.valueOf(x));
return Float.parseFloat(getAttributeNS(null, SVG_Y_ATTRIBUTE));
setAttributeNS(null, SVG_Y_ATTRIBUTE, String.valueOf(y));
return Float.parseFloat(getAttributeNS(null, SVG_DX_ATTRIBUTE));
setAttributeNS(null, SVG_DX_ATTRIBUTE, String.valueOf(dx));
return Float.parseFloat(getAttributeNS(null, SVG_DY_ATTRIBUTE));
setAttributeNS(null, SVG_DY_ATTRIBUTE, String.valueOf(dy)); | 0 |
LOG.error("Bad request: ", e); | 0 |
import org.apache.aurora.common.application.Application;
public class SchedulerMain implements Application { | 0 |
/**
* Copyright 2016 Seznam a.s.
*
* 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.avalon.framework.service.ServiceException;
import org.apache.avalon.framework.service.ServiceManager;
* @version CVS $Id: CIncludeTransformer.java,v 1.7 2003/10/21 12:39:16 cziegeler Exp $
* @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
public void service(ServiceManager manager) throws ServiceException {
super.service(manager);
if ( this.manager.hasService( IncludeCacheManager.ROLE )) {
this.manager.release( this.cacheManager );
} catch (ServiceException ignore) {
this.manager.release(parser);
this.manager.release(processor);
} catch(ServiceException e) {
} catch (ServiceException ce) {
} catch (ServiceException ce) { | 0 |
* <p>Implementation object representing an <strong>item</strong> in the | 0 |
import org.apache.felix.scr.impl.manager.AbstractComponentManager;
public abstract class ComponentActivatorTask implements Runnable | 0 |
// only STANDARD types don't have a parent
if (entity.getType() == RepositoryType.STANDARD) { | 0 |
* @return The Accumulo instance.
* @return The Accumulo instance. | 0 |
JXPathContext jxobjectModel = JXPathContext.newContext(objectModel.get(ObjectModel.CONTEXTBEAN));
jxobjectModel.setNamespaceContextPointer(new NamespacesTablePointer((NamespacesTable)objectModel.get(ObjectModel.NAMESPACE))); | 0 |
* Copyright 2016 Seznam.cz, a.s. | 0 |
.apply(CreateDataflowView.<ElemT, ViewT>forStreaming(view)); | 0 |
HashSet<String> closed = null;
closed = getClosedLogs(conn);
log.info("Found " + closed.size() + " WALs referenced in metadata in " + sw.toString());
recordsClosed = updateReplicationEntries(conn, closed);
protected HashSet<String> getClosedLogs(Connector conn) {
HashSet<String> result = new HashSet<>();
if (entry.getValue() == WalState.UNREFERENCED || entry.getValue() == WalState.CLOSED) {
log.debug("Found closed WAL " + path.toString());
result.add(path.toString());
return result; | 0 |
*
*
*
* @version CVS $Id$
public final class CocoonComponentManager extends ExcaliburComponentManager {
super(manager, loader);
super(manager);
public Component lookup(final String role)
if(null == role) {
throws ComponentException {
public void initialize() throws Exception {
| 0 |
import cz.seznam.euphoria.shadow.com.google.common.base.Preconditions; | 0 |
import org.junit.Ignore;
public Map<Resource.Type, PropertyId> getKeyPropertyIds() {
return keyPropertyIds;
@Ignore
// Assert.assertEquals(, controller.getSchema(Resource.Type.Host));
@Override
public List<PropertyProvider> getPropertyProviders(Resource.Type type) {
return propertyProviders;
}
public Map<Resource.Type, PropertyId> getKeyPropertyIds() {
return keyPropertyIds; | 0 |
throw new H2ConnectionException(H2Error.INTERNAL_ERROR, "Unexpected executable command"); | 0 |
public class FactoryConfigurationAdapterAnnotationTest extends TestBase {
public FactoryConfigurationAdapterAnnotationTest() {
super(true /* start test components bundle */);
}
| 0 |
*
*
*
/**
* @version $Revision: 1.5 $
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
/**
/** | 1 |
import org.apache.commons.bcel6.ExceptionConst;
ExceptionConst.ILLEGAL_MONITOR_STATE | 0 |
* http://www.apache.org/licenses/LICENSE-2.0 | 0 |
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* <p/>
* http://www.apache.org/licenses/LICENSE-2.0
* <p/>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ambari.view.hive.resources.uploads.parsers;
public class EndOfDocumentException extends Exception {
public EndOfDocumentException() {
}
public EndOfDocumentException(String message) {
super(message);
}
public EndOfDocumentException(String message, Throwable cause) {
super(message, cause);
}
public EndOfDocumentException(Throwable cause) {
super(cause);
}
public EndOfDocumentException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
} | 0 |
private static final Set<String> pkPropertyIds = new HashSet<>( | 0 |
import org.apache.beam.sdk.annotations.Experimental;
| 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 |
expected.app.allowedJobEnvironments = "^(foo|bar|zaa)$";
"-allowed_job_environments=^(foo|bar|zaa)$", | 0 |
* Generates authentication header for the proxy host, if required,
* based on the actual state of the HTTP authentication context.
*
public void process(final HttpRequest request, final HttpContext context)
| 0 |
* @param <T> Result type | 0 |
if (clientConf.hasSasl()) { | 0 |
this.bws = new HashMap<>();
HashMap<String,Set<SecurityErrorCode>> tables = new HashMap<>();
secCodes = new HashSet<>(); | 0 |
NUMERIC_DEFAULTS.put( BigInteger.class, BigInteger.ZERO );
NUMERIC_DEFAULTS.put( BigDecimal.class, BigDecimal.ZERO ); | 0 |
/*
import org.apache.ambari.server.security.authorization.Users;
import java.util.Collection;
protected static final String PRIVILEGE_PRIVILEGE_ID_PROPERTY_ID = PrivilegeResourceProvider.PRIVILEGE_ID_PROPERTY_ID;
protected static final String PRIVILEGE_PRINCIPAL_NAME_PROPERTY_ID = PrivilegeResourceProvider.PRINCIPAL_NAME_PROPERTY_ID;
protected static final String PRIVILEGE_PRINCIPAL_TYPE_PROPERTY_ID = PrivilegeResourceProvider.PRINCIPAL_TYPE_PROPERTY_ID;
protected static final String PRIVILEGE_VIEW_NAME_PROPERTY_ID = ViewPrivilegeResourceProvider.PRIVILEGE_VIEW_NAME_PROPERTY_ID;
protected static final String PRIVILEGE_VIEW_VERSION_PROPERTY_ID = ViewPrivilegeResourceProvider.PRIVILEGE_VIEW_VERSION_PROPERTY_ID;
protected static final String PRIVILEGE_INSTANCE_NAME_PROPERTY_ID = ViewPrivilegeResourceProvider.PRIVILEGE_INSTANCE_NAME_PROPERTY_ID;
protected static final String PRIVILEGE_CLUSTER_NAME_PROPERTY_ID = ClusterPrivilegeResourceProvider.PRIVILEGE_CLUSTER_NAME_PROPERTY_ID;
protected static final String PRIVILEGE_TYPE_PROPERTY_ID = AmbariPrivilegeResourceProvider.PRIVILEGE_TYPE_PROPERTY_ID;
protected static final String PRIVILEGE_USER_NAME_PROPERTY_ID = "PrivilegeInfo/user_name";
* Helper to obtain privilege data for requested users
private static Users users;
* @param users the Users helper object
ViewInstanceDAO viewInstanceDAO, Users users) {
UserPrivilegeResourceProvider.users = users;
final Collection<PrivilegeEntity> privileges = users.getUserPrivileges(userEntity); | 0 |
if (!result) {
return (v instanceof Boolean) && (Boolean) v;
return !(Boolean) v; | 0 |
import org.apache.sshd.common.scp.ScpStreamResolverFactory;
private ScpStreamResolverFactory scpStreamFactory;
public ScpStreamResolverFactory getScpStreamResolverFactory() {
return scpStreamFactory;
}
@Override
public void setScpStreamResolverFactory(ScpStreamResolverFactory factory) {
scpStreamFactory = factory;
}
@Override | 0 |
import org.apache.excalibur.source.Source;
Source source =
DynamicSelectionList list = new DynamicSelectionList(datatype, null, xmlizer, sourceResolver, null);
DOMBuilder dest = new DOMBuilder();
dest.startDocument();
dest.endDocument();
Document destDocument = dest.getDocument();
Source expectedSource =
assertEqual("Test if output is what is expected", expected, destDocument); | 0 |
public MergeState nextMergeState(Connector connector, CurrentState master) throws Exception {
if (verifyMergeConsistency(connector, master))
state = MergeState.MERGING;
else
log.info("Merge consistency check failed " + info.getRange());
private boolean verifyMergeConsistency(Connector connector, CurrentState master) throws TableNotFoundException, IOException { | 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.handlers.event.publisher;
import java.util.Dictionary;
/**
* An Publisher is the interface between the EventAdminPublisherHandler and a
* component instance. The POJO can send event through the handler by calling a
* {@code send} method.
*
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
*/
public interface Publisher {
/**
* Send an event with the specified content.
*
* @param content
* the content of the event
*/
void send(Dictionary content);
/**
* Send a data event.
*
* @param o
* the data to send
*/
void sendData(Object o);
} | 0 |
EasyMock.expect(context.getClient()).andReturn(accumuloClient).anyTimes();
assertEquals(MergeState.WAITING_FOR_OFFLINE, stats.nextMergeState(accumuloClient, state));
assertEquals(MergeState.WAITING_FOR_CHOPPED, stats.nextMergeState(accumuloClient, state));
assertEquals(MergeState.WAITING_FOR_OFFLINE, stats.nextMergeState(accumuloClient, state)); | 0 |
public class MBeanServerTracker extends ServiceTracker<MBeanServer, MBeanContainer>
super(context, MBeanServer.class, null);
public MBeanContainer addingService(ServiceReference<MBeanServer> reference)
if ( server != null )
{
MBeanContainer mBeanContainer = new MBeanContainer(server);
this.server.addEventListener(mBeanContainer);
return mBeanContainer;
}
else
{
super.removedService(reference, null);
}
return null;
public void removedService(ServiceReference<MBeanServer> reference, MBeanContainer service)
if ( service != null )
{
this.server.removeEventListener(service);
super.removedService(reference, service);
} | 0 |
import java.util.ArrayList;
import org.apache.ambari.server.state.StackInfo;
final AmbariMetaInfo mockAmbariMetaInfo = easyMockSupport.createNiceMock(AmbariMetaInfo.class);
final StackInfo mockStackInfo = easyMockSupport.createNiceMock(StackInfo.class);
final RepositoryInfo mockRepositoryInfo = easyMockSupport.createNiceMock(RepositoryInfo.class);
expect(mockCluster.getClusterName()).andReturn("cc").anyTimes();
expect(mockAmbariMetaInfo.getStack("HDP", "2.2")).andReturn(mockStackInfo);
expect(mockStackInfo.getRepositories()).andReturn(new ArrayList<RepositoryInfo>() {{
add(mockRepositoryInfo);
}});
public void testRepositoryTable() {
final RepositoryInfo repositoryInfo1 = new RepositoryInfo();
repositoryInfo1.setOsType("redhat6");
repositoryInfo1.setRepoId("HDP-2.2");
repositoryInfo1.setBaseUrl("http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.2.6.0");
final RepositoryInfo repositoryInfo2 = new RepositoryInfo();
repositoryInfo2.setOsType("suse11");
repositoryInfo2.setRepoId("HDP-UTILS-1.1.0.20");
repositoryInfo2.setBaseUrl("http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/suse11sp3");
List<RepositoryInfo> repos = new ArrayList<RepositoryInfo>() {{
add(repositoryInfo1);
add(repositoryInfo2);
}};
String output = UpgradeCatalog200.repositoryTable(repos);
assertEquals(" redhat6 | HDP-2.2 | http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.2.6.0 \n" +
" suse11 | HDP-UTILS-1.1.0.20 | http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/suse11sp3 \n",
output);
}
@Test | 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.Before;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mockito;
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<>();
@Before
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("HIVE", hive);
EasyMock.expect(cluster.getServices()).andReturn(m_services).anyTimes();
EasyMock.expect(request.getClusterName()).andReturn(m_clusterName).anyTimes();
EasyMock.expect(request.getUpgradeType()).andReturn(UpgradeType.ROLLING).anyTimes();
EasyMock.expect(request.getTargetRepositoryVersion()).andReturn(m_repositoryVersion).atLeastOnce(); | 0 |
package org.w3c.dom.svg;
public interface SVGLinearGradientElement extends
SVGGradientElement {
public SVGAnimatedLength getX1( );
public SVGAnimatedLength getY1( );
public SVGAnimatedLength getX2( );
public SVGAnimatedLength getY2( );
} | 1 |
import org.apache.felix.dependencymanager.test2.components.AspectAnnotation.ServiceAspect1;
import org.apache.felix.dependencymanager.test2.components.AspectAnnotation.ServiceAspect2;
import org.apache.felix.dependencymanager.test2.components.AspectAnnotation.ServiceAspect3;
import org.apache.felix.dependencymanager.test2.components.AspectAnnotation.ServiceConsumer;
import org.apache.felix.dependencymanager.test2.components.AspectAnnotation.ServiceProvider;
ServiceRegistration scSequencer = register(e, ServiceConsumer.ENSURE);
ServiceRegistration spSequencer = register(e, ServiceProvider.ENSURE);
ServiceRegistration sa2Sequencer = register(e, ServiceAspect2.ENSURE);
ServiceRegistration sa3Sequencer = register(e, ServiceAspect3.ENSURE);
ServiceRegistration sa1Sequencer = register(e, ServiceAspect1.ENSURE); | 0 |
import com.twitter.mesos.scheduler.TaskState; | 0 |
import org.apache.sshd.common.session.Session; | 0 |
private TaskStateMachine stateMachine;
stateMachine = makeStateMachine("test", makeTask(false));
private TaskStateMachine makeStateMachine(String taskId, ScheduledTask task) {
return new TaskStateMachine(taskId, taskId /* Job key */, task,
isJobUpdating, workSink, taskTimeoutFilter, clock, INIT);
stateMachine = makeStateMachine("test", makeTask(true));
stateMachine = makeStateMachine("test", makeTask(false));
break;
stateMachine = makeStateMachine("test", task);
stateMachine = makeStateMachine("test", task);
expectWork(UPDATE_STATE).times(5);
expectWork(RESCHEDULE);
stateMachine = makeStateMachine("test", task);
TaskStateMachine rescheduledMachine = makeStateMachine("test2", rescheduled);
stateMachine = makeStateMachine("test", task); | 0 |
import java.io.InputStream;
* @author <a href="mailto:a.saglimbeni@pro-netics.com">Alfio Saglimbeni</a>
* @version CVS $Id: SQLTransformer.java,v 1.7 2003/07/18 14:46:30 gianugo Exp $
public static final String CLOB_ENCODING = "clob-encoding";
/** Encoding we use for CLOB field */
protected String clobEncoding;
this.clobEncoding = parameters.getParameter(SQLTransformer.CLOB_ENCODING, "");
getLogger().debug( "CLOB_ENCODING: " + clobEncoding );
int numberOfChar = 1024;
if (rs.getMetaData().getColumnType(i) == 8) {
} else if (rs.getMetaData().getColumnType(i) == java.sql.Types.CLOB) {
Clob clob = rs.getClob(i);
InputStream inputStream = clob.getAsciiStream();
byte[] readByte = new byte[numberOfChar];
StringBuffer buffer = new StringBuffer();
try {
while(inputStream.read(readByte) > -1) {
String string = new String(readByte, clobEncoding);
buffer.append(string);
}
} catch(java.io.IOException ioException) {
throw new SQLException("Error reading stream from CLOB");
}
retval = buffer.toString();
} | 0 |
import org.w3c.css.sac.InputSource;
URL durl = doc.getURLObject();
durl,
InputSource is = new InputSource(url.toString());
result.setUserAgentStyleSheet(result.parseStyleSheet(is, url, "all")); | 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 |
* The category under which the Memory Usage Web Console Plugin
* is listed.
*/
static final String CATEGORY = "Web Console";
/** | 0 |
* {@link org.apache.beam.sdk.coders.VoidCoder}. We need this because Flink does not | 0 |
private void validateExpiration(final Map<String, String> map, final long timeout) { | 0 |
public synchronized static boolean isValidTablePropertyKey(String key) {
if (validTableProperties == null) {
validTableProperties = new HashSet<String>();
for (Property p : Property.values()) {
if (!p.getType().equals(PropertyType.PREFIX) && p.getKey().startsWith(Property.TABLE_PREFIX.getKey())) {
validTableProperties.add(p.getKey());
} | 0 |
* Copyright 2001-2006 The Apache Software Foundation | 0 |
import java.util.Collection;
void init(ClientSession session, String service, Collection<?> identities) throws Exception; | 0 |
import java.io.File;
final ProviderTestSuite testSuite = new ProviderTestSuite(new LocalProviderTestCase());
testSuite.addTests(FileNameTests.class);
public FileObject getBaseTestFolder(final FileSystemManager manager) throws Exception
return manager.toFileObject(testDir); | 0 |
package com.twitter.mesos.scheduler.storage.stream;
import com.twitter.mesos.scheduler.BaseSchedulerCoreImplTest;
import com.twitter.mesos.scheduler.JobManager;
import com.twitter.mesos.scheduler.storage.Storage;
expect(persistenceLayer.fetch()).andReturn(null).times(2); | 0 |
return Row.withSchema(getters.rowType()).addValues(fieldValues).build(); | 0 |
public FileName createName(final String path, final FileType type)
protected void appendRootUri(final StringBuilder buffer, final boolean addPassword) | 1 |
private static final long TIMEOUT = 30;
private static final long LONG_TIMEOUT = 60; | 0 |
import org.apache.http.nio.NHttpServerEventHandler;
public class LoggingNHttpServiceHandler implements NHttpServerEventHandler {
private final NHttpServerEventHandler handler;
public LoggingNHttpServiceHandler(final NHttpServerEventHandler handler) {
public void connected(
final NHttpServerConnection conn) throws IOException, HttpException {
public void exception(
final NHttpServerConnection conn, final Exception ex) {
public void requestReceived(
final NHttpServerConnection conn) throws IOException, HttpException {
public void outputReady(
final NHttpServerConnection conn,
final ContentEncoder encoder) throws IOException, HttpException {
public void responseReady(
final NHttpServerConnection conn) throws IOException, HttpException {
public void inputReady(
final NHttpServerConnection conn,
final ContentDecoder decoder) throws IOException, HttpException {
public void timeout(
final NHttpServerConnection conn) throws IOException {
} | 0 |
/*
* Copyright 2003-2004 The Apache Software Foundation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* @version $Revision: 1.3 $ $Date: 2004/02/18 00:58:18 $ | 0 |
/*
* $HeadURL$
* $Revision$
* $Date$
*
* ====================================================================
*
* Copyright 1999-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.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package org.apache.http.protocol;
import java.io.IOException;
import org.apache.http.HttpException;
import org.apache.http.HttpRequest;
import org.apache.http.HttpResponse;
/**
*
* @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a>
*
* @version $Revision$
*
* @since 4.0
*/
public interface HttpRequestHandler {
void handle(HttpRequest request, HttpResponse response, HttpContext context)
throws HttpException, IOException;
} | 0 |
private transient PersistenceBroker broker = null;
public PersistenceFlow() {
PBFactory factory = (PBFactory)getComponent(PBFactory.ROLE);
broker = factory.defaultPersistenceBroker();
releaseComponent(factory);
}
public void doInsertEmployee() throws BindingException { | 0 |
package org.apache.accumulo.cloudtrace.thrift; | 0 |
@Override
public String toString() {
return "stack " + getStackId();
}
| 0 |
* Create a name filter containing the names of the files | 0 |
enum MessageState { IDLE, HEADERS, ACK, BODY, COMPLETE } | 0 |
private final Map<String, Object> map;
this.map = new HashMap<String, Object>();
@Deprecated
public synchronized void setHandlers(final Map<String, Object> map) {
public synchronized void setObjects(final Map<String, Object> map) {
for (Iterator<String> it = this.map.keySet().iterator(); it.hasNext();) {
String pattern = it.next(); | 0 |
import org.apache.commons.vfs2.impl.DefaultFileSystemManager;
import org.apache.commons.vfs2.provider.FileProvider;
// TODO: VFS-360 - Remove this manual registration of http4 once http4 becomes part of standard providers.
boolean httpClient4Available = false;
try {
Class.forName("org.apache.http.client.HttpClient");
httpClient4Available = true;
final DefaultFileSystemManager manager = (DefaultFileSystemManager) VFS.getManager();
if (!manager.hasProvider("http4")) {
manager.addProvider("http4", (FileProvider) Class.forName("org.apache.commons.vfs2.provider.http4.Http4FileProvider").newInstance());
manager.addProvider("http4s", (FileProvider) Class.forName("org.apache.commons.vfs2.provider.http4s.Http4sFileProvider").newInstance());
}
} catch (Exception e) {
if (httpClient4Available) {
e.printStackTrace();
}
}
| 0 |
public class DaoUtils { | 0 |
import org.apache.beam.sdk.values.Row;
PCollection<Row> rows = compilePipeline(sql, pipeline, sqlEnv); | 0 |
package org.apache.beam.sdk.options;
import org.apache.beam.sdk.util.CredentialFactory;
import org.apache.beam.sdk.util.GcpCredentialFactory;
import org.apache.beam.sdk.util.InstanceBuilder; | 0 |
if (PTransformTranslation.COMBINE_PER_KEY_TRANSFORM_URN.equals( | 0 |
LOG.debug("setElement(\"{}\", \"{}\")", element.getTagName(), baseURI);
LOG.debug("setElement({}, \"{}\")", element.getTagName(), baseURI); | 0 |
package org.apache.atlas.typesystem.types;
import org.apache.atlas.MetadataException;
import org.apache.atlas.typesystem.ITypedStruct;
import org.apache.atlas.typesystem.Struct; | 0 |
public class MonitorInputStream extends BufferedInputStream {
public MonitorInputStream(final InputStream in) {
*
public synchronized int available() throws IOException {
if (finished.get()) {
*
public int read() throws IOException {
if (finished.get()) {
if (ch != EOF_CHAR) {
*
public int read(final byte[] buffer, final int offset, final int length) throws IOException {
if (finished.get()) {
if (nread != EOF_CHAR) {
* Closes this input stream and releases any system resources associated with the stream.
*
public void close() throws IOException {
if (closed) {
try {
} catch (final IOException ioe) {
try {
} catch (final IOException ioe) {
if (exc != null) {
* Called after the stream has been closed. This implementation does nothing.
*
protected void onClose() throws IOException {
*
public long getCount() { | 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
* 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 |
PCollection<T> input = p.apply(Create.of(Arrays.asList((T[]) users))
.withCoder((Coder<T>) AvroCoder.of(User.class))); | 0 |
@SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum { | 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;
/**
* Context Source Listener.
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
*/
public interface ContextListener {
/**
* A monitored value has been modified.
* @param source : context source containing the property
* @param property : modified property name
* @param value : new value of the property
*/
void update(ContextSource source, String property, Object value);
} | 0 |
*
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a> | 0 |
* <strong>NOTE:</strong> Caching of servlet: source is broken in some cases. See thread
* http://news.gmane.org/find-root.php?group=gmane.text.xml.cocoon.devel&article=72801
private String location;
private ServletConnection servletConnection;
/* (non-Javadoc)
* @see org.apache.excalibur.source.impl.AbstractSource#getInputStream()
*/
/* (non-Javadoc)
* @see org.apache.excalibur.source.impl.AbstractSource#getValidity()
*/
/* (non-Javadoc)
* @see org.apache.excalibur.source.impl.AbstractSource#getLastModified()
*/
if (lastModified > 0) {
} else {
store.remove(key);
}
| 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jelly/jelly-tags/bsf/src/java/org/apache/commons/jelly/tags/bsf/JPythonTagLibrary.java,v 1.1 2003/01/08 05:02:48 dion Exp $
* $Date: 2003/01/08 05:02:48 $
* $Id: JPythonTagLibrary.java,v 1.1 2003/01/08 05:02:48 dion Exp $ | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//validator/src/test/org/apache/commons/validator/MultipleTests.java,v 1.12 2003/08/26 16:12:47 rleland Exp $
* $Revision: 1.12 $
* $Date: 2003/08/26 16:12:47 $
* @version $Revision: 1.12 $ $Date: 2003/08/26 16:12:47 $
validator.setParameter(Validator.BEAN_PARAM, name);
validator.setParameter(Validator.BEAN_PARAM, name);
validator.setParameter(Validator.BEAN_PARAM, name);
validator.setParameter(Validator.BEAN_PARAM, name); | 0 |
List<String> lines = IOUtils.readLines(in);
List<String> lines = IOUtils.readLines(in, "UTF-8");
List<String> lines = IOUtils.readLines(in); | 0 |
public final class Messages {
private Messages() {
public static String getString(final String code) {
* @param code The message code.
* @param param The message parameter.
public static String getString(final String code, final Object param) {
return getString(code, new Object[] { param });
* @param code The message code.
public static String getString(final String code, final Object... params) {
try {
if (code == null) {
} catch (final MissingResourceException mre) {
private static MessageFormat findMessage(final String code) throws MissingResourceException {
if (msg != null) { | 1 |
import org.apache.avalon.framework.service.ServiceException;
* @version CVS $Id: VelocityGenerator.java,v 1.8 2003/09/04 09:38:33 cziegeler Exp $
public class VelocityGenerator extends ServiceableGenerator
} catch (ServiceException e) {
this.manager.release(parser); | 0 |
try {
factory.checkAcceptability(m_configuration);
} catch (UnacceptableConfiguration e) {
+ e.getMessage());
return false;
} catch (MissingHandlerException e) {
m_logger.log(Logger.ERROR, "An instance can be bound to a matching factory, but this factory cannot be used : "
+ e.getMessage());
return false; | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.