Diff
stringlengths 5
2k
| FaultInducingLabel
int64 0
1
|
---|---|
import org.apache.accumulo.core.client.impl.Tables;
import org.apache.accumulo.core.metadata.MetadataServicer;
TreeMap<KeyExtent,String> tabletLocations = new TreeMap<KeyExtent,String>();
String tableId = Tables.getNameToIdMap(inst).get(tableName);
TCredentials credentials = CredentialHelper.create(opts.principal, opts.getToken(), opts.instance);
MetadataServicer.forTableId(conn.getInstance(), credentials, tableId).getTabletLocations(tabletLocations);
for (Entry<KeyExtent,String> entry : tabletLocations.entrySet()) {
KeyExtent keyExtent = entry.getKey();
String loc = entry.getValue();
if (loc == null)
System.out.println(" Tablet " + keyExtent + " has no location");
else if (opts.verbose)
System.out.println(" Tablet " + keyExtent + " is located at " + loc);
if (loc != null) {
List<KeyExtent> extentList = extentsPerServer.get(loc);
if (extentList == null) {
extentList = new ArrayList<KeyExtent>();
extentsPerServer.put(loc, extentList);
}
if (check == null || check.contains(keyExtent))
extentList.add(keyExtent);
} | 1 |
import org.apache.accumulo.core.util.RootTable;
LocatorKey key = new LocatorKey(instance.getInstanceID(), tableId);
if (tableId.toString().equals(RootTable.ID)) {
tl = new RootTabletLocator(instance);
} else if (tableId.toString().equals(MetadataTable.ID)) {
tl = new TabletLocatorImpl(new Text(MetadataTable.ID), getInstance(instance, new Text(RootTable.ID)), mlo);
tl = new TabletLocatorImpl(tableId, getInstance(instance, new Text(MetadataTable.ID)), mlo); | 0 |
private static ThreadPoolExecutor readaheadPool = new ThreadPoolExecutor(0, Integer.MAX_VALUE, 3l, TimeUnit.SECONDS, new SynchronousQueue<>(), | 0 |
public class TestSuiteRunner extends Suite {
LOG.info(String.format("Testkit will schedule tests in '%s'.", testClass));
LOG.info(String.format("Test method found '%s' it will be scheduled to run.", method));
if (!isOperatorTest) {
addRunner(runners, testClass, method, null, paramsList);
continue;
}
Optional<Type> mPType = getProcessingType(method.getMethod());
checkArgument(
cPType.isPresent() || mPType.isPresent(),
"Processing annotation is missing either on method or class!");
Optional<Type> definedPType = merged(cPType, mPType);
checkArgument(definedPType.isPresent(), "Conflicting processings!");
Optional<Type> rPType = merged(kPType, definedPType);
if (rPType.isPresent()) {
for (Processing.Type ptype : rPType.get().asList()) {
addRunner(runners, testClass, method, ptype, paramsList);
addRunner(runners, testClass, method, null, paramsList);
acc.add(new ExecutorProviderTestMethodRunner(testClass, method, pType, null));
acc.add(new ExecutorProviderTestMethodRunner(testClass, method, pType, params));
Class<?> testClass, FrameworkMethod method, Processing.Type ptype, Object[] parameterList) | 0 |
import org.apache.ambari.server.orm.dao.StackDAO;
import org.apache.ambari.server.orm.entities.StackEntity;
* Data access object for retrieving stack instances.
*/
@Inject
private StackDAO stackDAO;
/**
StackEntity desiredStackEntity = serviceDesiredStateEntity.getDesiredStack();
if( null != desiredStackEntity ) {
return new StackId(desiredStackEntity);
} else {
return null;
}
public void setDesiredStackVersion(StackId stack) {
+ ", newDesiredStackVersion=" + stack);
StackEntity stackEntity = stackDAO.find(stack.getStackName(), stack.getStackVersion());
serviceDesiredStateEntity.setDesiredStack(stackEntity); | 0 |
} catch (final IOException ex) {
} catch (final IOException ex) {
} catch (final IOException ex) {
} catch (final IOException ex) {
} catch (final IOException ex) { | 0 |
if (uri.startsWith("file:") || baseURI != null && baseURI.startsWith("file:")) { | 0 |
public void testOnMergeFiresNotAlreadyFinished() throws Exception {
setUp(Sessions.withGapDuration(Duration.millis(10)));
when(mockTrigger1.onElement(Mockito.<Trigger<IntervalWindow>.OnElementContext>any()))
.thenReturn(TriggerResult.CONTINUE);
when(mockTrigger2.onElement(Mockito.<Trigger<IntervalWindow>.OnElementContext>any()))
.thenReturn(TriggerResult.CONTINUE);
tester.injectElements(
TimestampedValue.of(1, new Instant(1)),
TimestampedValue.of(5, new Instant(12)));
when(mockTrigger1.onMerge(Mockito.<Trigger<IntervalWindow>.OnMergeContext>any()))
.thenReturn(MergeResult.ALREADY_FINISHED);
when(mockTrigger2.onMerge(Mockito.<Trigger<IntervalWindow>.OnMergeContext>any()))
.thenReturn(MergeResult.ALREADY_FINISHED);
tester.injectElements(
TimestampedValue.of(12, new Instant(5)));
assertThat(tester.extractOutput(), Matchers.contains(
isSingleWindowedValue(Matchers.containsInAnyOrder(1, 5, 12), 1, 1, 22)));
assertTrue(tester.isMarkedFinished(new IntervalWindow(new Instant(1), new Instant(22))));
tester.assertHasOnlyGlobalAndFinishedSetsFor(
new IntervalWindow(new Instant(1), new Instant(22)));
}
@Test | 0 |
public String getVfsContextClasspathProperty(String key) {
return getConfiguration().getArbitrarySystemProperty(Property.VFS_CONTEXT_CLASSPATH_PROPERTY, key); | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//validator/src/share/org/apache/commons/validator/ValidatorResult.java,v 1.11 2004/02/21 17:10:29 rleland Exp $
* $Revision: 1.11 $
* $Date: 2004/02/21 17:10:29 $
* 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. | 0 |
private static final Collection<ByteSequence> EMPTY_SET = new HashSet<>();
TreeMap<Key,Value> tm1 = new TreeMap<>();
TreeMap<Key,Value> tm2 = new TreeMap<>();
HashSet<ByteSequence> colfams = new HashSet<>();
TreeMap<Key,Value> tm1 = new TreeMap<>();
HashSet<ByteSequence> allColfams = new HashSet<>();
HashSet<ByteSequence> colfams = new HashSet<>();
HashSet<ByteSequence> excpected1 = new HashSet<>(colfams);
HashSet<ByteSequence> excpected2 = new HashSet<>(allColfams);
HashSet<ByteSequence> ocf = new HashSet<>();
TreeMap<Key,Value> tm1 = new TreeMap<>();
HashSet<ByteSequence> colfams = new HashSet<>(); | 0 |
import com.google.common.collect.FluentIterable;
FluentIterable<TaskConfig> tasks =
FluentIterable
.from(configs)
.transform(taskExtractor)
.filter(Predicates.notNull());
return Quotas.fromProductionTasks(tasks);
Quota quota = Quotas.fromProductionTasks(Iterables.transform( | 0 |
for (E e : this) {
out.writeObject(e); | 0 |
ChoppedColumnFamily.NAME, ClonedColumnFamily.NAME)); | 0 |
private static AssignedTask makeTask(String startCommand, Set<String> requestedPorts) {
.setRequestedPorts(requestedPorts)
assertEquals(ports.size(), task.getTask().getRequestedPortsSize());
AssignedTask task = makeTask("echo '%port:http%'", ImmutableSet.of("http"));
AssignedTask task = makeTask("echo '%port:http%'; echo '%port:http%';",
ImmutableSet.of("http"));
AssignedTask task = makeTask("echo '%port:http%'; echo '%port:thrift%'; echo '%port:mail%'",
ImmutableSet.of("http", "thrift", "mail"));
AssignedTask task = makeTask("echo '%port:http% %port:web%'", ImmutableSet.of("http", "web"));
AssignedTask task = makeTask("echo %shard_id%", ImmutableSet.<String>of());
AssignedTask task = makeTask("echo %task_id%", ImmutableSet.<String>of());
AssignedTask task = makeTask("echo %port: foo %", ImmutableSet.<String>of()); | 0 |
public interface WindowAware<IN, W extends Window<W>> { | 0 |
public class PointerEventsFactory
extends AbstractIdentifierFactory
implements SVGValueConstants {
values.put(CSS_ALL_VALUE, ALL_VALUE);
values.put(CSS_FILL_VALUE, FILL_VALUE);
values.put(CSS_FILLSTROKE_VALUE, FILLSTROKE_VALUE);
values.put(CSS_NONE_VALUE, NONE_VALUE);
values.put(CSS_PAINTED_VALUE, PAINTED_VALUE);
values.put(CSS_STROKE_VALUE, STROKE_VALUE);
values.put(CSS_VISIBLE_VALUE, VISIBLE_VALUE);
values.put(CSS_VISIBLEFILL_VALUE, VISIBLEFILL_VALUE);
values.put(CSS_VISIBLEFILLSTROKE_VALUE, VISIBLEFILLSTROKE_VALUE);
values.put(CSS_VISIBLEPAINTED_VALUE, VISIBLEPAINTED_VALUE);
values.put(CSS_VISIBLESTROKE_VALUE, VISIBLESTROKE_VALUE);
return CSS_POINTER_EVENTS_PROPERTY; | 0 |
public static final String ID_REPOSITORY_VIEW = "org.apache.felix.sigil.ui.repositoryBrowser";
public static final String ID_DEPENDENCY_VIEW = "org.apache.felix.sigil.ui.bundleDependencyView"; | 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 |
* @see #setSecurityProvider(String)
* Except, all your encrypted files now contain a setting that says "hey I was encrypted by the default strategy, so find decrypt my key using that, not the
* key management server". This setting signals the {@link CryptoModule} that it should ignore the setting in the file and prefer the one from the
* configuration. | 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: JXTemplateGenerator.java,v 1.38 2004/03/05 13:02:55 bdelacretaz Exp $ | 1 |
// LONG[] --> StringBuffer
try {
msg = "LONG[] --> StringBuffer";
Object result = arrayConverter.convert(StringBuffer.class, LONGArray);
assertEquals(msg, StringBuffer.class, result.getClass());
assertEquals(msg, stringB, result.toString());
} catch (Exception e) {
fail(msg + " failed " + e);
}
| 0 |
import org.apache.aurora.scheduler.events.EventSink;
import org.apache.aurora.scheduler.events.PubsubEvent.SchedulerActive;
ACTIVE,
DriverFactory driverFactory,
NonVolatileStorage storage,
Lifecycle lifecycle,
Driver driver,
DriverReference driverRef,
Clock clock,
EventSink eventSink) {
clock,
eventSink);
final Clock clock,
final EventSink eventSink) {
eventSink.post(new SchedulerActive());
State.ACTIVE, State.DEAD)
State.ACTIVE, | 0 |
* Copyright 2002-2006 The Apache Software Foundation.
*
*
*
* Not equal to. Use '!=' or 'ne', do not use <>.
*
* @author <a href="mailto:[email protected]">Geir Magnusson Jr.</a>
* @version $Id$
public class ASTNENode extends SimpleNode {
public ASTNENode(int id) {
public ASTNENode(Parser p, int id) {
/** Accept the visitor. * */
public Object jjtAccept(ParserVisitor visitor, Object data) {
public Object value(JexlContext pc) throws Exception {
Object left = ((SimpleNode) jjtGetChild(0)).value(pc);
Object right = ((SimpleNode) jjtGetChild(1)).value(pc);
if (left == null && right == null) {
} else if (left == null || right == null) {
} else if (left.getClass().equals(right.getClass())) {
} else if (left instanceof Float
|| left instanceof Double
|| right instanceof Float
|| right instanceof Double) {
return (Coercion.coerceDouble(left).equals(Coercion.coerceDouble(right))) ? Boolean.FALSE : Boolean.TRUE;
} else if (left instanceof Number || right instanceof Number || left instanceof Character
|| right instanceof Character) {
return (Coercion.coerceLong(left).equals(Coercion.coerceLong(right))) ? Boolean.FALSE : Boolean.TRUE;
} else if (left instanceof Boolean || right instanceof Boolean) {
return (Coercion.coerceBoolean(left).equals(Coercion.coerceBoolean(right))) ? Boolean.FALSE : Boolean.TRUE;
} else if (left instanceof java.lang.String || right instanceof String) { | 0 |
Copyright 2002 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.commons.configuration.tree.DefaultExpressionEngineSymbols;
static final String ATTR_NAME = DefaultExpressionEngineSymbols.DEFAULT_ATTRIBUTE_START
+ DefaultExpressionEngineSymbols.DEFAULT_ATTRIBUTE_END;
static final String ATTR_AT_RES = DefaultExpressionEngineSymbols.DEFAULT_ATTRIBUTE_START
+ DefaultExpressionEngineSymbols.DEFAULT_ATTRIBUTE_END;
static final String ATTR_AT = DefaultExpressionEngineSymbols.DEFAULT_ATTRIBUTE_START
+ ATTR_ATNAME + DefaultExpressionEngineSymbols.DEFAULT_ATTRIBUTE_END;
static final String ATTR_OPTIONAL_RES = DefaultExpressionEngineSymbols.DEFAULT_ATTRIBUTE_START
+ DefaultExpressionEngineSymbols.DEFAULT_ATTRIBUTE_END;
static final String ATTR_OPTIONAL = DefaultExpressionEngineSymbols.DEFAULT_ATTRIBUTE_START
+ ATTR_OPTIONALNAME + DefaultExpressionEngineSymbols.DEFAULT_ATTRIBUTE_END;
static final String ATTR_FILENAME = DefaultExpressionEngineSymbols.DEFAULT_ATTRIBUTE_START
+ "fileName" + DefaultExpressionEngineSymbols.DEFAULT_ATTRIBUTE_END;
static final String ATTR_FORCECREATE = DefaultExpressionEngineSymbols.DEFAULT_ATTRIBUTE_START
+ DefaultExpressionEngineSymbols.DEFAULT_ATTRIBUTE_END;
static final String ATTR_RELOAD = DefaultExpressionEngineSymbols.DEFAULT_ATTRIBUTE_START
+ DefaultExpressionEngineSymbols.DEFAULT_ATTRIBUTE_END; | 0 |
int numComps = GenericUtils.length(comps);
String pathArg = (numComps <= 0) ? null : GenericUtils.trimToEmpty(comps[numComps - 1]);
String flags = (numComps >= 2) ? GenericUtils.trimToEmpty(comps[0]) : null;
// ignore all flags
if ((GenericUtils.length(pathArg) > 0) && (pathArg.charAt(0) == '-')) {
flags = pathArg;
pathArg = null;
int version = sftp.getVersion();
boolean showLongName = (version == SftpConstants.SFTP_V3) && (GenericUtils.length(flags) > 1) && (flags.indexOf('l') > 0);
if (showLongName) {
stdout.append("\t\tlong-name: ").println(entry.getLongFilename());
} | 0 |
ProcessBundleHandler processBundleHandler = new ProcessBundleHandler(
options,
fnApiRegistry::getById,
beamFnDataMultiplexer,
null /* beamFnStateClient */); | 0 |
void sendInformation(HttpResponse response) throws HttpException, IOException;
| 0 |
// test per-table classpath + user specified compaction strategy
target.mkdirs(); | 0 |
Cookie[] cookies = request.getCocoonCookies(); | 0 |
Map<String, Map<String, Object>> propertyMap = new HashMap<String, Map<String, Object>>();
propertyMap.put(null, mapRootProps);
propertyMap.put("category", mapCategoryProps);
expect(resource.getPropertiesMap()).andReturn(propertyMap).anyTimes(); | 0 |
import org.apache.accumulo.core.client.impl.Table;
Path getFullPath(Table.ID tableId, String path); | 1 |
* @version $Id$ | 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.dm.lambda.samples.hello;
/**
* The interface for our service provider.
*
* @author <a href="mailto:[email protected]">Felix Project Team</a>
*/
public interface ServiceProvider {
public void hello();
} | 0 |
import org.apache.avalon.framework.service.ServiceException;
import org.apache.avalon.framework.service.ServiceManager;
import org.apache.cocoon.environment.internal.EnvironmentHelper;
* @version CVS $Id: SourceRepository.java,v 1.5 2004/05/25 07:28:25 cziegeler Exp $
private static ServiceManager manager;
manager = EnvironmentHelper.getSitemapServiceManager();
} catch (ServiceException ce) { | 0 |
import org.apache.sshd.common.session.Session;
void init(Session session, byte[] v_s, byte[] v_c, byte[] i_s, byte[] i_c) throws Exception; | 0 |
session.put(PROPERTY_CONFIG_PID, null);
session.put(PROPERTY_CONFIG_PROPS, null); | 0 |
* Copyright 2002-2005 The Apache Software Foundation. | 0 |
public IntegerConverterTestCase(final String name) {
protected NumberConverter makeConverter(final Object defaultValue) {
final String[] message= {
final Object[] input = {
final Integer[] expected = {
final Converter converter = makeConverter();
final Class<?> clazz = Integer.class;
final Long min = new Long(Integer.MIN_VALUE);
final Long max = new Long(Integer.MAX_VALUE);
final Long minMinusOne = new Long(min.longValue() - 1);
final Long maxPlusOne = new Long(max.longValue() + 1);
} catch (final Exception e) {
} catch (final Exception e) {
final NumberConverter converter = makeConverter();
} catch (final ConversionException cex) { | 0 |
import static org.junit.Assert.assertEquals;
import org.junit.Test; | 0 |
new HashMap<String,String>() {{ put("a", "b"); }}, new HashMap<>());
}}, new HashMap<>());
}}, new HashMap<>()); | 0 |
import org.apache.accumulo.core.security.tokens.AuthenticationToken;
* <li>{@link AccumuloInputFormat#setConnectorInfo(JobConf, String, AuthenticationToken)} OR {@link AccumuloInputFormat#setConnectorInfo(JobConf, Path)} | 0 |
abstract class EarlyTriggeredWindowContext<GROUP, LABEL>
extends WindowContext<GROUP, LABEL> {
private final Trigger earlyTrigger;
public EarlyTriggeredWindowContext(
WindowID<GROUP, LABEL> windowID,
Duration interval, long endOfWindow) {
super(windowID);
} else {
this.earlyTrigger = null; | 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.dm.annotation.api;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* This annotation can be used to be notified when a component is unregistered from the registry.
* At this point, the component has been unregistered from the OSGI registry (if it provides some services).
* The method must not take any parameters.
*
* <p>
* <h3>Usage Examples</h3>
* <blockquote>
*
* <pre>
* @Component
* class X implements Z {
* @Stop
* void stop(ServiceRegistration sr) {
* // Our service must stop because it is about to be unregistered from the registry.
* }
*
* @Unregistered
* void unregistered() {
* // At this point, our service has been unregistered from the OSGi registry
* }
* }
* </pre>
* </blockquote>
*
* @author <a href="mailto:[email protected]">Felix Project Team</a>
*/
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.METHOD)
public @interface Unregistered
{
} | 0 |
throw new IOException("Could not initialize key encryption cache,"
+ " malformed key encryption key file. Expected key of lengh "
+ keyEncryptionKeyLength + " but file contained "
+ (fs.getFileStatus(pathToKey).getLen() - 4) + "bytes for key encryption key.");
throw new IOException("Could not initialize key encryption cache,"
+ " unable to access or find key encryption key file", e); | 0 |
import org.apache.accumulo.core.util.HostAndPort; | 1 |
import aQute.bnd.annotation.ConsumerType;
@ConsumerType | 0 |
CacheEntry updatedEntry = impl.doGetUpdatedParentEntry(null, entry, variantURI); | 0 |
private List<Object> m_failedDetail = new ArrayList<Object>();
public List<Object> getFailedDetail() {
return m_failedDetail;
}
| 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//io/src/test/org/apache/commons/io/Attic/IOTestSuite.java,v 1.6 2003/08/21 18:56:12 jeremias Exp $
* $Revision: 1.6 $
* $Date: 2003/08/21 18:56:12 $
suite.addTest( new TestSuite( CopyUtilsTest.class ) );
suite.addTest( new TestSuite( FileUtilsTestCase.class ) ); | 0 |
public static final String CONFIGURATION_TYPE_RANGER_HIVE_PLUGIN_PROPERTIES = "ranger-hive-plugin-properties";
public static final String PROPERTY_RANGER_HIVE_PLUGIN_ENABLED = "ranger-hive-plugin-enabled"; | 0 |
ResourceType resourceType = ResourceType.translate(typeName);
if(resourceType != null) {
switch (resourceType) {
case AMBARI:
// there is nothing special to add for this case
break;
case CLUSTER:
ClusterEntity clusterEntity = (ClusterEntity) resourceEntities.get(resourceEntity.getId());
setResourceProperty(resource, PRIVILEGE_CLUSTER_NAME_PROPERTY_ID, clusterEntity.getClusterName(), requestedIds);
break;
case VIEW:
ViewInstanceEntity viewInstanceEntity = (ViewInstanceEntity) resourceEntities.get(resourceEntity.getId());
ViewEntity viewEntity = viewInstanceEntity.getViewEntity();
setResourceProperty(resource, PRIVILEGE_VIEW_NAME_PROPERTY_ID, viewEntity.getCommonName(), requestedIds);
setResourceProperty(resource, PRIVILEGE_VIEW_VERSION_PROPERTY_ID, viewEntity.getVersion(), requestedIds);
setResourceProperty(resource, PRIVILEGE_INSTANCE_NAME_PROPERTY_ID, viewInstanceEntity.getName(), requestedIds);
break;
}
setResourceProperty(resource, PRIVILEGE_TYPE_PROPERTY_ID, resourceType.name(), requestedIds);
| 0 |
package util;
import org.apache.accumulo.core.data.Key;
public class KeyParser extends BaseKeyParser
{
public static final String SELECTOR_FIELD = "selector";
public static final String DATATYPE_FIELD = "dataType";
public static final String FIELDNAME_FIELD = "fieldName";
public static final String UID_FIELD = "uid";
public static final String DELIMITER = "\0";
@Override
public void parse(Key key)
{
super.parse (key);
String[] colFamParts = this.keyFields.get(BaseKeyParser.COLUMN_FAMILY_FIELD).split(DELIMITER);
this.keyFields.put(FIELDNAME_FIELD, colFamParts.length >= 2 ? colFamParts[1] : "");
String[] colQualParts = this.keyFields.get(BaseKeyParser.COLUMN_QUALIFIER_FIELD).split(DELIMITER);
this.keyFields.put(SELECTOR_FIELD, colQualParts.length >= 1 ? colQualParts[0] : "");
this.keyFields.put(DATATYPE_FIELD, colQualParts.length >= 2 ? colQualParts[1] : "");
this.keyFields.put(UID_FIELD, colQualParts.length >= 3 ? colQualParts[2] : "");
}
@Override
public BaseKeyParser duplicate ()
{
return new KeyParser();
}
public String getSelector()
{
return keyFields.get(SELECTOR_FIELD);
}
public String getDataType()
{
return keyFields.get(DATATYPE_FIELD);
}
public String getFieldName ()
{
return keyFields.get(FIELDNAME_FIELD);
}
public String getUid()
{
return keyFields.get(UID_FIELD);
}
public String getDataTypeUid()
{
return getDataType()+DELIMITER+getUid();
}
// An alias for getSelector
public String getFieldValue()
{
return getSelector();
}
} | 1 |
import javax.annotation.Nullable;
import org.apache.beam.sdk.extensions.euphoria.core.annotation.audience.Audience;
import org.apache.beam.sdk.extensions.euphoria.core.client.dataset.windowing.Window; | 0 |
package org.apache.hc.client5.http.impl.io;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import org.apache.hc.core5.http.impl.io.SocketHolder;
class LoggingSocketHolder extends SocketHolder {
private final Wire wire;
LoggingSocketHolder(final Socket socket, final Wire wire) {
super(socket);
this.wire = wire;
}
@Override
protected InputStream getInputStream(final Socket socket) throws IOException {
return new LoggingInputStream(super.getInputStream(socket), wire);
}
@Override
protected OutputStream getOutputStream(final Socket socket) throws IOException {
return new LoggingOutputStream(super.getOutputStream(socket), wire);
} | 0 |
HttpHost target = new HttpHost("localhost", 80, "http");
new AuthScope(target.getHostName(), target.getPort()),
.setDefaultCredentialsProvider(credsProvider)
.build();
authCache.put(target, digestAuth);
System.out.println("Executing request " + httpget.getRequestLine() + " to target " + target);
CloseableHttpResponse response = httpclient.execute(target, httpget, localContext);
EntityUtils.consume(response.getEntity()); | 0 |
finishFunctions::add,
null /* splitListener */); | 0 |
if ( ReferenceMetadata.FIELD_VALUE_TYPE_SERVICE.equals(metadata.getFieldCollectionType()) )
else if ( ReferenceMetadata.FIELD_VALUE_TYPE_REFERENCE.equals(metadata.getFieldCollectionType()) )
else if ( ReferenceMetadata.FIELD_VALUE_TYPE_SERVICEOBJECTS.equals(metadata.getFieldCollectionType()) )
else if ( ReferenceMetadata.FIELD_VALUE_TYPE_PROPERTIES.equals(metadata.getFieldCollectionType()) )
else if ( ReferenceMetadata.FIELD_VALUE_TYPE_TUPLE.equals(metadata.getFieldCollectionType()) ) | 0 |
*
*
*
*
* | 0 |
import java.util.function.Consumer;
* @param parameterSetter Consumer to populate the template.
Consumer<StringTemplate> parameterSetter) throws TemplateException {
parameterSetter.accept(stringTemplate); | 0 |
import static org.apache.beam.sdk.extensions.sql.SqlTypeCoders.INTEGER;
import static org.apache.beam.sdk.extensions.sql.SqlTypeCoders.VARCHAR;
Column.builder().name("id").coder(INTEGER).primaryKey(true).build(),
Column.builder().name("name").coder(VARCHAR).primaryKey(false).build() | 0 |
import org.apache.cocoon.xml.XMLUtils;
* @version CVS $Id: WidgetReplacingPipe.java,v 1.3 2004/03/09 13:17:26 cziegeler Exp $
contentHandler.startElement(Constants.INSTANCE_NS, STYLING_EL, Constants.INSTANCE_PREFIX_COLON + STYLING_EL, XMLUtils.EMPTY_ATTRIBUTES); | 0 |
* Annotates a method returning the list of objects which are part of a Component implementation.
* When implementing complex Components, you often need to use more than one object instances.
* Moreover, several of these instances might want to have dependencies injected, as was as lifecycle
* callbacks invoked, like the methods annotated with {@link Init}, {@link Start}, {@link Stop},
* {@link Destroy} annotations. In such cases you can tell the dependency manager which instances to
* consider, by annotating a method in your Component, returning a list of objects which are part
* of the implementation.
* <p>
* This annotation may be applied on a method which is part of class annotated with either a {@link Component},
* {@link AspectService}, {@link AdapterService}, or {@link ResourceAdapterService} annotation. | 0 |
private final transient PCollection<T> originalOutput;
private static class StreamingPubsubIOWriteOverrideFactory | 0 |
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.dom;
import org.w3c.dom.CDATASection;
/**
* This class implements a wrapper for a CDATASection. All the methods
* of the underlying document are called in a single thread.
*
* @author <a href="mailto:[email protected]">Stephane Hillion</a>
* @version $Id$
*/
public class CDATASectionWrapper extends TextWrapper implements CDATASection {
/**
* Creates a new CDATASectionWrapper object.
*/
public CDATASectionWrapper(DocumentWrapper dw, CDATASection c) {
super(dw, c);
}
} | 0 |
package org.apache.beam.sdk.util;
import org.apache.beam.sdk.io.BigQueryIO;
import org.apache.beam.sdk.transforms.Aggregator;
import org.apache.beam.sdk.transforms.Combine.CombineFn;
import org.apache.beam.sdk.transforms.Sum;
| 0 |
public void addComponent( final String role, | 0 |
* @version $Id$ | 0 |
* @version $Revision: 1.6 $ $Date: 2004/05/10 20:09:44 $ | 0 |
private static final long serialVersionUID = 1L;
| 0 |
import java.util.Map;
public boolean areEqualValues(Object val1, Object val2, Map<String, String> guidAssignments) {
if (!elementType.areEqualValues(Array.get(val1, i), Array.get(val2, i), guidAssignments)) {
if (elementType.areEqualValues(elem1, elem2, guidAssignments)) {
if (!elementType.areEqualValues(list1.get(i), list2.get(i), guidAssignments)) { | 0 |
import java.util.Collection;
import org.apache.http.client.config.AuthSchemes;
import org.apache.http.client.config.RequestConfig;
abstract class AuthenticationStrategyImpl implements AuthenticationStrategy {
AuthSchemes.SPNEGO,
AuthSchemes.KERBEROS,
AuthSchemes.NTLM,
AuthSchemes.DIGEST,
AuthSchemes.BASIC
AuthenticationStrategyImpl(int challengeCode, final String headerName) {
abstract Collection<String> getPreferredAuthSchemes(RequestConfig config);
RequestConfig config = clientContext.getRequestConfig();
Collection<String> authPrefs = getPreferredAuthSchemes(config);
return schemeName.equalsIgnoreCase(AuthSchemes.BASIC) ||
schemeName.equalsIgnoreCase(AuthSchemes.DIGEST); | 0 |
*
* @version $Id$ | 0 |
import org.apache.felix.sigil.common.osgi.VersionRange;
import org.apache.felix.sigil.common.osgi.VersionRangeBoundingRule; | 0 |
/*
* Copyright (c) 2015, Cloudera, Inc. All Rights Reserved.
*
* Cloudera, Inc. 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
*
* This software 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 com.cloudera.dataflow.spark;
import java.io.IOException;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.mapreduce.JobContext;
import org.apache.hadoop.mapreduce.TaskAttemptContext;
import org.apache.hadoop.mapreduce.TaskID;
import org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter;
import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;
public class TemplatedTextOutputFormat<K, V> extends TextOutputFormat<K, V> {
public static final String OUTPUT_FILE_TEMPLATE = "spark.dataflow.textoutputformat.template";
@Override
public void checkOutputSpecs(JobContext job) {
// don't fail if the output already exists
}
@Override
public Path getDefaultWorkFile(TaskAttemptContext context,
String extension) throws IOException {
// note that the passed-in extension is ignored since it comes from the template
FileOutputCommitter committer =
(FileOutputCommitter) getOutputCommitter(context);
return new Path(committer.getWorkPath(), getOutputFile(context));
}
private String getOutputFile(TaskAttemptContext context) {
TaskID taskId = context.getTaskAttemptID().getTaskID();
int partition = taskId.getId();
String outputFileTemplate = context.getConfiguration().get(OUTPUT_FILE_TEMPLATE);
return ShardNameBuilder.replaceShardNumber(outputFileTemplate, partition);
}
} | 0 |
dbAccessor.dropPKConstraint(HOSTS_TABLE, "hosts_pkey", "host_name", true);
dbAccessor.dropPKConstraint(CONFIG_GROUP_HOST_MAPPING_TABLE, "configgrouphostmapping_pkey", HOST_NAME_COL, true);
dbAccessor.dropPKConstraint(CLUSTER_HOST_MAPPING_TABLE, "clusterhostmapping_pkey",HOST_NAME_COL, true);
dbAccessor.dropPKConstraint(HOST_CONFIG_MAPPING_TABLE, "hostconfigmapping_pkey", HOST_NAME_COL, true);
dbAccessor.dropPKConstraint(HOST_COMPONENT_STATE_TABLE, "hostcomponentstate_pkey", HOST_NAME_COL, true);
dbAccessor.dropPKConstraint(HOST_COMPONENT_DESIRED_STATE_TABLE, "hostcomponentdesiredstate_pkey", HOST_NAME_COL, true);
dbAccessor.dropPKConstraint(HOST_STATE_TABLE, "hoststate_pkey", HOST_NAME_COL, true);
dbAccessor.dropPKConstraint(KERBEROS_PRINCIPAL_HOST_TABLE, "kerberos_principal_host_pkey", HOST_NAME_COL, true);
dbAccessor.dropPKConstraint(SERVICE_CONFIG_HOSTS_TABLE, "serviceconfighosts_pkey", "hostname", true); | 0 |
Copyright 1999-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 HashedMap(final Map<? extends K, ? extends V> map) { | 0 |
* http://www.apache.org/licenses/LICENSE-2.0 | 0 |
List<ServiceTestInvocation> listInvocations = new ArrayList<>(); | 1 |
Collections.unmodifiableSet(EnumSet.of(SftpClient.OpenMode.Read));
Collections.unmodifiableSet(
EnumSet.of(
SftpClient.OpenMode.Write,
SftpClient.OpenMode.Append,
SftpClient.OpenMode.Create,
SftpClient.OpenMode.Truncate)); | 0 |
// Exclusive requests changes
dbAccessor.addColumn("request", new DBColumnInfo(
"exclusive_execution", Integer.class, 1, 0, false));
| 0 |
XMLSignatureInput result = new XMLSignatureInput(input.getSubNode());
XMLSignatureInput result = new XMLSignatureInput(resultSet); | 0 |
package org.apache.commons.ognl.enhance;
import org.apache.commons.ognl.Node;
import org.apache.commons.ognl.OgnlContext; | 0 |
private final SortedKeyValueIterator<Key,Value> source;
private final boolean continueOnError; | 0 |
* @author <a href="http://commons.apache.org/vfs/team-list.html">Commons VFS team</a> | 0 |
/*
* Copyright 2016-2018 Seznam.cz, a.s. | 0 |
Assert.assertEquals(200, response.getCode());
Assert.assertEquals(200, response.getCode());
Assert.assertEquals(200, response.getCode());
Assert.assertEquals(200, response.getCode());
Assert.assertEquals(200, response.getCode()); | 0 |
import java.io.File;
import java.io.FilePermission;
import java.util.Collection;
public LocalFileSystem(final FileName rootName,
final String rootFile)
super(rootName, null, null);
protected FileObject createFile(final FileName name)
return new LocalFile(this, fileName, name);
protected void addCapabilities(final Collection caps)
caps.add(Capability.CREATE);
caps.add(Capability.DELETE);
caps.add(Capability.RENAME);
caps.add(Capability.GET_TYPE);
caps.add(Capability.GET_LAST_MODIFIED);
caps.add(Capability.SET_LAST_MODIFIED);
caps.add(Capability.LIST_CHILDREN);
caps.add(Capability.READ_CONTENT);
caps.add(Capability.URI);
caps.add(Capability.WRITE_CONTENT);
caps.add(Capability.APPEND_CONTENT);
protected File doReplicateFile(final FileObject fileObject,
final FileSelector selector)
final LocalFile localFile = (LocalFile) fileObject;
if (sm != null)
final FilePermission requiredPerm = new FilePermission(file.getAbsolutePath(), "read");
sm.checkPermission(requiredPerm); | 0 |
/** The property, may be null. */
if (obj != null
&& objectClass.equals(obj.getClass())
// ensure method name matches the property name
&& method != null
&& ((property == null && key == null)
|| (property != null && property.equals(key)))) { | 0 |
this(validateAndConvertToMillis(timeToLive, timeUnit));
return TimeUnit.MILLISECONDS.convert(timeToLive, timeUnit); | 0 |
@Test
Response.ResponseBuilder responseBuilderMock = PowerMock.createMock(ResponseBuilderImpl.class);
Response responseMock = createMock(ResponseImpl.class);
InputStream es = new ByteArrayInputStream("error".getBytes());
PowerMock.mockStatic(Response.class);
expect(urlConnectionMock.getResponseCode()).andReturn(400).times(2);
expect(urlConnectionMock.getContentType()).andReturn("text/plain");
expect(urlConnectionMock.getErrorStream()).andReturn(es);
expect(Response.status(400)).andReturn(responseBuilderMock);
expect(responseBuilderMock.entity(es)).andReturn(responseBuilderMock);
expect(responseBuilderMock.type("text/plain")).andReturn(responseBuilderMock);
expect(responseBuilderMock.build()).andReturn(responseMock);
PowerMock.replay(streamProviderMock, URLStreamProvider.class, uriMock, URI.class, Response.class, responseBuilderMock);
Response resultForErrorRequest = ps.processGetRequestForwarding(getHttpHeaders(),getUriInfo());
assertSame(resultForErrorRequest, responseMock); | 0 |
import cz.seznam.euphoria.flink.FlinkElement;
implements FlatMapFunction<FlinkElement<WID, IN>,
FlinkElement<WID, OUT>>,
ResultTypeQueryable<FlinkElement<WID, OUT>> {
public void flatMap(FlinkElement<WID, IN> value,
Collector<FlinkElement<WID, OUT>> out)
out.collect(new FlinkElement<>(
public TypeInformation<FlinkElement<WID, OUT>> getProducedType() {
return TypeInformation.of((Class) FlinkElement.class); | 0 |
import org.apache.beam.sdk.coders.AtomicCoder;
import org.apache.beam.sdk.coders.Coder;
import org.apache.beam.sdk.coders.CoderException;
import org.apache.beam.sdk.coders.StringUtf8Coder;
import org.apache.beam.sdk.coders.VarLongCoder;
| 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.
* @version $Id: VelPropertySet.java,v 1.3 2004/02/28 13:45:22 yoavs Exp $ | 0 |
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License. | 0 |
* 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. | 0 |
* Copyright 2001-2005 The Apache Software Foundation | 0 |
if (null == tableConf) {
log.trace("Could not get configuration for table {} (it no longer exists)", table);
continue;
}
| 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.