Diff stringlengths 5 2k | FaultInducingLabel int64 0 1 |
|---|---|
/*
* Copyright 2004-2005 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.portal.coplets.basket.events;
import org.apache.cocoon.portal.coplets.basket.Briefcase;
/**
* Clean all briefcases or a single one.
*
* @version $Id$
*/
public class CleanBriefcaseEvent extends ContentStoreEvent {
/**
* Constructor
* If this constructor is used all baskets will be cleaned
*/
public CleanBriefcaseEvent() {
// nothing to do here
}
/**
* Constructor
* One briefcase will be cleaned
* @param briefcase The briefcase
*/
public CleanBriefcaseEvent(Briefcase briefcase) {
super(briefcase);
}
} | 0 |
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ambari.server.upgrade;
import com.google.inject.Inject;
import com.google.inject.Injector;
import org.apache.ambari.server.AmbariException;
import org.apache.ambari.server.utils.VersionUtils;
import java.sql.SQLException;
/**
* Final upgrade catalog which simply updates database version (in case if no db changes between releases)
*/
public class FinalUpgradeCatalog extends AbstractUpgradeCatalog {
@Inject
public FinalUpgradeCatalog(Injector injector) {
super(injector);
}
@Override
protected void executeDDLUpdates() throws AmbariException, SQLException {
//noop
}
@Override
protected void executePreDMLUpdates() throws AmbariException, SQLException {
//noop
}
@Override
protected void executeDMLUpdates() throws AmbariException, SQLException {
//noop
}
@Override
public String getTargetVersion() {
return getFinalVersion();
}
@Override
public boolean isFinal() {
return true;
}
private String getFinalVersion() {
return VersionUtils.getVersionSubstring(configuration.getServerVersion());
}
} | 0 |
import org.apache.beam.runners.core.SplittableParDoViaKeyedWorkItems;
import org.apache.beam.runners.core.construction.ElementAndRestriction;
SplittableParDoViaKeyedWorkItems.ProcessElements.class,
new SplittableProcessElementsStreamingTranslator());
SplittableParDoViaKeyedWorkItems.GBKIntoKeyedWorkItems.class,
new GBKIntoKeyedWorkItemsTranslator());
* Helper for translating {@link ParDo.MultiOutput} and {@link
* SplittableParDoViaKeyedWorkItems.ProcessElements}.
} else if (doFn instanceof SplittableParDoViaKeyedWorkItems.ProcessFn) {
SplittableParDoViaKeyedWorkItems.ProcessElements<InputT, OutputT, RestrictionT, TrackerT>> {
SplittableParDoViaKeyedWorkItems.ProcessElements<InputT, OutputT, RestrictionT, TrackerT>
transform,
context.getInput(transform),
SplittableParDoViaKeyedWorkItems.GBKIntoKeyedWorkItems<K, InputT>> {
SplittableParDoViaKeyedWorkItems.GBKIntoKeyedWorkItems<K, InputT> transform,
SplittableParDoViaKeyedWorkItems.GBKIntoKeyedWorkItems<K, InputT> transform, | 0 |
/** A graph node which contains some pipeline element. */
/** A {@link PipelineNode} which contains a {@link PCollection}. */
@Override
public abstract String getId();
/** A {@link PipelineNode} which contains a {@link PTransform}. */
@Override
public abstract String getId();
| 1 |
import org.apache.xml.security.stax.securityEvent.DefaultTokenSecurityEvent;
TestSecurityEventListener securityEventListener = new TestSecurityEventListener();
XMLStreamReader securityStreamReader =
inboundXMLSec.processInMessage(xmlStreamReader, null, securityEventListener);
// Compare the keys
DefaultTokenSecurityEvent tokenEvent =
(DefaultTokenSecurityEvent)securityEventListener.getTokenEvent(SecurityEventConstants.DefaultToken);
assertNotNull(tokenEvent);
Key processedKey = tokenEvent.getSecurityToken().getSecretKey("", null);
assertEquals(processedKey, key);
TestSecurityEventListener securityEventListener = new TestSecurityEventListener();
XMLStreamReader securityStreamReader =
inboundXMLSec.processInMessage(xmlStreamReader, null, securityEventListener);
// Compare the keys
DefaultTokenSecurityEvent tokenEvent =
(DefaultTokenSecurityEvent)securityEventListener.getTokenEvent(SecurityEventConstants.DefaultToken);
assertNotNull(tokenEvent);
Key processedKey = tokenEvent.getSecurityToken().getSecretKey("", null);
assertEquals(processedKey, key); | 0 |
import org.apache.commons.lang3.ArrayUtils;
@UDF(
funcName = "REVERSE",
parameterArray = {TypeName.STRING},
returnType = TypeName.STRING
)
public String reverse(String str) {
return new StringBuilder(str).reverse().toString();
}
@UDF(
funcName = "REVERSE",
parameterArray = {TypeName.BYTES},
returnType = TypeName.BYTES
)
public byte[] reverse(byte[] bytes) {
ArrayUtils.reverse(bytes);
return bytes;
} | 0 |
* @throws Exception | 0 |
package org.apache.beam.sdk.io;
import org.apache.beam.sdk.coders.Coder;
import org.apache.beam.sdk.options.PipelineOptions;
import org.apache.beam.sdk.values.PCollection; | 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 |
if(pendingSyncs.containsKey(zxid)){
sendSync(syncHandler.get(pendingSyncs.get(zxid).sessionId), pendingSyncs.get(zxid));
syncHandler.remove(pendingSyncs.get(zxid));
pendingSyncs.remove(zxid);
}
if(f != null){
QuorumPacket qp = new QuorumPacket(Leader.SYNC, 0, null, null);
f.queuePacket(qp);
}
else{
LOG.warn("Committing sync: " + r.cxid );
zk.commitProcessor.commit(r);
} | 0 |
String prefix = Util.getPrefix(cls);
f = cls.getDeclaredField(Util.mangleName(prefix, entry.getKey().toString()));
} catch (NoSuchFieldException | NullPointerException e) {
f = cls.getField(Util.mangleName(prefix, entry.getKey().toString()));
} catch (NoSuchFieldException | NullPointerException e1) {
// There is no field with this name | 0 |
for (final Iterator<String> it = config.getKeys(); it.hasNext();)
final String key = it.next();
final String key = config.getKeys().next(); | 0 |
* The <code>Metrics</code> is a utility class for producing various kinds of metrics for reporting
* properties of an executing pipeline.
*
/** Create a metric that records various statistics about the distribution of reported values. */
/** Create a metric that records various statistics about the distribution of reported values. */
@Override
public void inc() {
@Override
public void inc(long n) {
@Override
public void dec() {
@Override
public void dec(long n) {
@Override
public MetricName getName() {
@Override
public MetricName getName() {
/** Implementation of {@link Gauge} that delegates to the instance for the current context. */
@Override
public MetricName getName() { | 1 |
protected String userAgent = DEFAULT_USER_AGENT;
protected String accept = DEFAULT_ACCEPT;
// Get parameters, headers, deparameterized URI and path from URI
final TreeMap headers = new TreeMap();
headers.put("user-agent", userAgent);
headers.put("accept", accept);
getPage(deparameterizedURI, 0L, parameters, headers, null, null, outputStream);
// Get parameters, headers, deparameterized URI and path from URI
final TreeMap headers = new TreeMap();
headers.put("user-agent", userAgent);
headers.put("accept", accept);
getPage(deparameterizedURI, 0L, parameters, headers, null, null, handler);
final TreeMap headers = new TreeMap();
headers.put("user-agent", userAgent);
headers.put("accept", accept);
parameters, headers, cliContext, log);
Map headers,
headers.put("user-agent", userAgent);
headers.put("accept", accept);
null, parameters, headers, links,
Map headers,
headers.put("user-agent", userAgent);
headers.put("accept", accept);
null, parameters, headers, links,
final TreeMap headers = new TreeMap();
headers.put("user-agent", userAgent);
headers.put("accept", accept);
parameters, headers, empty, null, cliContext, | 0 |
* @version $Revision$ | 0 |
* Copyright 2004,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: DisplayNameSetImpl.java,v 1.2 2004/03/05 13:02:15 bdelacretaz Exp $ | 1 |
import com.twitter.common.application.ShutdownRegistry;
ScheduledExecutorSchedulingService(ShutdownRegistry shutdownRegistry,
ShutdownRegistry shutdownRegistry, | 0 |
Entity entity = getEntityByType(sortedHiveOutputs, Type.TABLE);
if (entity != null) {
Table outTable = entity.getTable();
//refresh table
outTable = dgiBridge.hiveClient.getTable(outTable.getDbName(), outTable.getTableName());
return HiveMetaStoreBridge.getTableProcessQualifiedName(dgiBridge.getClusterName(), outTable);
} | 0 |
import javax.inject.Inject; | 0 |
if (v.getId() == i) {
if (leader == v.getId()) {
long id = votes[0].getId();
if (votes[i].getId() != id) {
if (allowOneBadLeader && votes[i].getId() == i) {
Assert.fail("Thread " + i + " got " + votes[i].getId() + " expected " + id); | 0 |
final HttpContext context = new BasicHttpContext();
final SchemeRegistry registry = SchemeRegistryFactory.createDefault();
final HttpParams params = getParams();
final String className = (String) params.getParameter(
final Class<?> clazz = Class.forName(className);
} catch (final ClassNotFoundException ex) {
} catch (final IllegalAccessException ex) {
} catch (final InstantiationException ex) {
final AuthSchemeRegistry registry = new AuthSchemeRegistry();
final CookieSpecRegistry registry = new CookieSpecRegistry();
final BasicHttpProcessor proc = getHttpProcessor();
final int reqc = proc.getRequestInterceptorCount();
final HttpRequestInterceptor[] reqinterceptors = new HttpRequestInterceptor[reqc];
final int resc = proc.getResponseInterceptorCount();
final HttpResponseInterceptor[] resinterceptors = new HttpResponseInterceptor[resc];
final HttpContext defaultContext = createHttpContext();
final HttpHost targetForRoute = (target != null) ? target
final HttpRoute route = routePlanner.determineRoute(targetForRoute, request, execContext);
} catch (final RuntimeException re) {
} catch (final Exception e) {
} catch(final HttpException httpException) { | 0 |
public String testAddChild(final String badParameter) {
public String testAddChild2(final String ignore, final String badParameter) {
public String testAddChild(final Child child) {
public String testAddChild2(final String ignore, final Child child) { | 0 |
return this.dynaClass;
return !eof;
return this; | 0 |
import org.apache.commons.collections.iterators.SingletonIterator; | 0 |
* @since 5.0
private final static String FORM_SUBTYPE = "form-data";
private final static String MIXED_SUBTYPE = "mixed";
private List<MultipartPart> multipartParts = null;
public MultipartEntityBuilder addPart(final MultipartPart multipartPart) {
if (multipartPart == null) {
if (this.multipartParts == null) {
this.multipartParts = new ArrayList<>();
this.multipartParts.add(multipartPart);
final ContentType contentTypeCopy;
if (contentType != null) {
contentTypeCopy = contentType.withParameters(params);
} else {
boolean formData = false;
if (multipartParts != null) {
for (final MultipartPart multipartPart : multipartParts) {
if (multipartPart instanceof FormBodyPart) {
formData = true;
break;
}
}
}
if (formData) {
contentTypeCopy = ContentType.create("multipart/" + FORM_SUBTYPE, params);
} else {
contentTypeCopy = ContentType.create("multipart/" + MIXED_SUBTYPE, params);
}
}
final List<MultipartPart> multipartPartsCopy = multipartParts != null ? new ArrayList<>(multipartParts) :
Collections.<MultipartPart>emptyList();
final AbstractMultipartFormat form;
form = new HttpBrowserCompatibleMultipart(charsetCopy, boundaryCopy, multipartPartsCopy);
form = new HttpRFC6532Multipart(charsetCopy, boundaryCopy, multipartPartsCopy);
form = new HttpRFC7578Multipart(charsetCopy, boundaryCopy, multipartPartsCopy);
form = new HttpStrictMultipart(StandardCharsets.US_ASCII, boundaryCopy, multipartPartsCopy); | 0 |
package org.apache.ambari.server.topology.validators;
/*
* 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
* distributed under the License is distributed on an "AS IS" BASIS,
import org.apache.ambari.server.topology.Blueprint;
import org.apache.ambari.server.topology.ClusterTopology;
import org.apache.ambari.server.topology.HostGroup;
import org.apache.ambari.server.topology.HostGroupInfo;
import org.apache.ambari.server.topology.InvalidTopologyException;
import org.apache.ambari.server.topology.TopologyValidator; | 0 |
* @return the versions service
@Path("{viewName}/versions")
public ViewVersionService getInstanceHandler(@PathParam("viewName") String viewName) {
return new ViewVersionService(viewName); | 0 |
for (final ColumnHandler handler : columns) {
for (final PropertyHandler handler : properties) {
for (final ColumnHandler handler : columns) {
for (final PropertyHandler handler : properties) { | 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.atlas.repository.graphdb;
/**
* Enumeration of the supported versions of Gremlin
*
*
*/
public enum GremlinVersion {
TWO,
THREE
} | 0 |
mgmt.addIndexKey(graphIndex, mgmt.makePropertyKey("guid").dataType(String.class).make());
Configuration indexConfig = getConfiguration("indexer.properties", INDEXER_PREFIX);
// Properties are formatted: prop_name:type;prop_name:type | 0 |
String getSqlState();
void setSqlState(String sqlState);
String getStatusMessage();
void setStatusMessage(String message); | 0 |
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
private ScheduledExecutorService executor;
executor = createMock(ScheduledExecutorService.class);
expect(executor.schedule(
EasyMock.capture(capture),
eq(expireIn.as(Time.MILLISECONDS).longValue()),
eq(TimeUnit.MILLISECONDS)))
.andReturn(null); | 0 |
* Returns the original file name in the client's file system, as provided by
* @return The original file name in the client's file system. | 0 |
final Collection<? extends FileLocationStrategy> subs)
public URL locate(final FileSystem fileSystem, final FileLocator locator)
for (final FileLocationStrategy sub : getSubStrategies())
final URL url = sub.locate(fileSystem, locator); | 0 |
mergePropWithRandomPort(Property.GC_PORT.getKey()); | 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 |
import java.util.Objects;
accessTime = Objects.requireNonNull(atime, "No access time");
createTime = Objects.requireNonNull(ctime, "No create time");
modifyTime = Objects.requireNonNull(mtime, "No modify time");
this.acl = Objects.requireNonNull(acl, "No ACLs");
this.extensions = Objects.requireNonNull(extensions, "No extensions"); | 0 |
thrown.expectMessage(
containsString("Building a Coder using a registered CoderFactory failed"));
thrown.expectMessage(
containsString("Building a Coder from the @DefaultCoder annotation failed"));
thrown.expectMessage(
containsString("Building a Coder from the fallback CoderProvider failed"));
thrown.expectMessage(
containsString("Building a Coder using a registered CoderFactory failed"));
thrown.expectMessage(
containsString("Building a Coder from the @DefaultCoder annotation failed"));
thrown.expectMessage(
containsString("Building a Coder from the fallback CoderProvider failed")); | 0 |
import org.apache.accumulo.hadoopImpl.mapreduce.lib.OutputConfigurator;
import org.apache.hadoop.conf.Configuration;
private final Class<?> callingClass;
public OutputFormatBuilderImpl(Class<?> callingClass) {
this.callingClass = callingClass;
}
_store(job.getConfiguration());
private void _store(Configuration conf) {
OutputConfigurator.setClientInfo(callingClass, conf, clientInfo);
OutputConfigurator.setDefaultTableName(callingClass, conf, defaultTableName.get());
OutputConfigurator.setCreateTables(callingClass, conf, createTables);
OutputConfigurator.setSimulationMode(callingClass, conf, simulationMode);
}
private void store(JobConf jobConf) {
_store(jobConf); | 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 |
import org.apache.zookeeper.AsyncCallback.StringCallback;
import org.apache.zookeeper.ZKUtil;
options.addOption("R", false, "recurse");
super("ls", "[-s] [-w] [-R] path");
boolean recursive = cl.hasOption("R");
if (recursive) {
ZKUtil.visitSubTreeDFS(zk, path, watch, new StringCallback() {
@Override
public void processResult(int rc, String path, Object ctx, String name) {
out.println(path);
}
});
Stat stat = withStat ? new Stat() : null;
List<String> children = zk.getChildren(path, watch, stat);
printChildren(children, stat);
private void printChildren(List<String> children, Stat stat) {
out.append("[");
out.append(", ");
out.append(child);
}
out.append("]");
if (stat != null) {
new StatPrinter(out).print(stat);
out.append("\n"); | 0 |
import org.apache.beam.sdk.options.DataflowPipelineOptions;
import org.apache.beam.sdk.options.Default;
import org.apache.beam.sdk.options.DefaultValueFactory;
import org.apache.beam.sdk.options.Description;
import org.apache.beam.sdk.options.PipelineOptions; | 0 |
RECOMMEND_CONFIGURATION_DEPENDENCIES("recommend-configuration-dependencies"),
| 0 |
clazz = Thread.currentThread().getContextClassLoader().loadClass(src); | 0 |
import java.util.Collection;
import edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicInteger;
private final Collection<ServiceReference> added = new ArrayList<ServiceReference>();
added.add( ref );
synchronized (added)
{
//wait for enable to complete
}
if (added.contains( ref ))
{
added.remove( ref );
m_size++;
serviceAdded( ref );
}
synchronized ( added )
{
// register the service listener
String filterString = "(" + Constants.OBJECTCLASS + "=" + m_dependencyMetadata.getInterface() + ")";
m_componentManager.getActivator().getBundleContext().addServiceListener( this, filterString );
// get the current number of registered services available
ServiceReference refs[] = getFrameworkServiceReferences();
if (refs != null)
{
for (ServiceReference ref: refs)
{
added.remove( ref );
}
}
m_size = ( refs == null ) ? 0 : refs.length;
}
"Not registered for service events since the bundle has no permission to get service {0}", new Object[]
{m_dependencyMetadata.getInterface()}, null );
"DependencyManager : Component not set, no need to call updated method", null ); | 0 |
throw io;
throw io; | 0 |
import org.apache.beam.sdk.transforms.windowing.IntervalWindow;
import org.apache.beam.sdk.util.WindowedValue;
public void testTableRowInfoCoderSerializable() {
CoderProperties.coderSerializable(BigQueryIO.TableRowInfoCoder.of());
}
@Test
public void testComplexCoderSerializable() {
CoderProperties.coderSerializable(
WindowedValue.getFullCoder(
KvCoder.of(
BigQueryIO.ShardedKeyCoder.of(StringUtf8Coder.of()),
BigQueryIO.TableRowInfoCoder.of()),
IntervalWindow.getCoder()));
}
@Test | 0 |
if (hd == null)
return 0;
if (o1.count < o2.count)
return -1;
if (o1.count > o2.count)
return 1; | 1 |
import org.apache.felix.scr.impl.logger.ComponentLogger;
* Return type for {@link FieldUtils#searchField(Class, String, ComponentLogger)}
public static final class FieldSearchResult
final ComponentLogger logger )
logger.log( LogService.LOG_DEBUG,
"Locating field {0} in class {1}", null, fieldName, theClass.getName() );
try
logger.log( LogService.LOG_ERROR, "Field {0} cannot be found in component class {1}. The field will be ignored.",
ex.getTargetException(),
fieldName, componentClass.getName() );
// nothing found
logger.log( LogService.LOG_ERROR, "Field {0} cannot be found in component class {1}. The field will be ignored.", null,
fieldName, componentClass.getName() );
final ComponentLogger logger )
logger.log( LogService.LOG_DEBUG, "Declared Field {0}.{1} not found", null, targetClass.getName(), fieldName );
* If the field is not usable, a {@code FieldSearchResult} with the usable
final ComponentLogger logger)
logger.log( LogService.LOG_ERROR, "Field {0} must not be static", null, toString(componentClass, field) );
"findField: Suitable but non-accessible field {0}", null, toString(componentClass, field));
if ( componentClass.getName().equals(field.getDeclaringClass().getName()) )
@Override
public static void setField( final Field f,
final ComponentLogger logger )
logger.log( LogService.LOG_ERROR, "Field {0} can't be set", iae, f.getName() );
logger.log( LogService.LOG_ERROR, "Field {0} can't be set", iae, f.getName() ); | 0 |
import com.google.cloud.dataflow.sdk.transforms.windowing.GlobalWindows;
import com.google.cloud.dataflow.sdk.transforms.windowing.Window;
return
new IterableAssert<>(inGlobalWindows(actual).apply(View.<T>asIterable()))
return new IterableAssert<>(inGlobalWindows(actual).apply(View.<Iterable<T>>asSingleton()))
return new SingletonAssert<>(inGlobalWindows(actual).apply(View.<T>asSingleton()))
* Returns a new PCollection equivalent to the input, but with all elements
* in the GlobalWindow. Preserves ordering if the input is ordered.
*/
private static <T> PCollection<T> inGlobalWindows(PCollection<T> input) {
return input
.apply(Window.<T>into(new GlobalWindows()))
.setOrdered(input.isOrdered());
}
/** | 0 |
* A lexicoder for preserving the native Java sort order of Double values.
* | 0 |
assertEquals(42L, memFunc.apply("42").longValue());
assertEquals(42L, memFunc.apply("42b").longValue());
assertEquals(42L, memFunc.apply("42B").longValue());
assertEquals(42L * 1024L, memFunc.apply("42K").longValue());
assertEquals(42L * 1024L, memFunc.apply("42k").longValue());
assertEquals(42L * 1024L * 1024L, memFunc.apply("42M").longValue());
assertEquals(42L * 1024L * 1024L, memFunc.apply("42m").longValue());
assertEquals(42L * 1024L * 1024L * 1024L, memFunc.apply("42G").longValue());
assertEquals(42L * 1024L * 1024L * 1024L, memFunc.apply("42g").longValue()); | 0 |
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;
import org.apache.accumulo.server.util.NamingThreadFactory;
import org.apache.accumulo.server.zookeeper.DistributedWorkQueue;
private DistributedWorkQueue bulkFailedCopyQ;
ThreadPoolExecutor distWorkQThreadPool = (ThreadPoolExecutor) Executors.newFixedThreadPool(
ServerConfiguration.getSystemConfiguration().getCount(Property.TSERV_WORKQ_THREADS),
new NamingThreadFactory("distributed work queue"));
bulkFailedCopyQ = new DistributedWorkQueue(Constants.ZROOT + "/" + HdfsZooInstance.getInstance().getInstanceID() + Constants.ZBULK_FAILED_COPYQ);
try {
bulkFailedCopyQ.startProcessing(new BulkFailedCopyProcessor(), distWorkQThreadPool);
} catch (Exception e1) {
throw new RuntimeException("Failed to start distributed work queue for copying ", e1);
}
| 0 |
public Comparator<ScanInfo> createComparator(CreateParameters params) {
Preconditions.checkArgument(params.getOptions().isEmpty()); | 0 |
public class SoftRefFilesCacheTests extends AbstractFilesCacheTestsBase | 0 |
public void setSocketTimeoutMillis(final int timeout) {
public int getSocketTimeoutMillis() { | 0 |
Document doc, EncryptionMethod encryptionMethod, KeyInfo keyInfo, CipherData cipherData, EncryptionProperties encryptionProperties, String Id, String Type)
Document doc, String encryptionMethod, EncryptionMethodParams encryptionMethodParams, KeyInfo keyInfo, EncryptionProperties encryptionProperties, String Id)
keyInfo, (CipherData) null, encryptionProperties, Id, (String) null);
EncryptionMethodParams encryptionMethodParams, KeyInfo keyInfo, CipherData cipherData, EncryptionProperties encryptionProperties, String Id, String Type)
keyInfo, cipherData, encryptionProperties, Id, Type);
byte ciphertext[] = em.encrypt(plaintext, secretKey);
byte ciphertext[] = em.encrypt(plaintext, contentEncryptionKey);
byte ciphertext[] = em.encrypt(plaintext, contentEncryptionKey);
byte plaintext[] = em.decrypt(ciphertext, contentDecryptionKey);
null, ki, null, "myFirstEncryptedElement"); | 0 |
return this.convert.toMap(rs); | 0 |
}
public ParentClass(final StringBuffer n) {
name = n.toString(); | 0 |
import com.google.common.base.Optional;
return;
Optional<TaskQuery> activeQuery = Optional.absent();
Optional<TaskQuery> completedQuery = Optional.absent();
if (Tasks.isActive(statusFilter)) {
activeQuery = Optional.of(query);
} else {
completedQuery = Optional.of(query);
}
activeQuery = Optional.of(new TaskQuery(query).setStatuses(Tasks.ACTIVE_STATES));
completedQuery = Optional.of(new TaskQuery(query).setStatuses(Tasks.TERMINAL_STATES));
}
if (activeQuery.isPresent()) {
Set<ScheduledTask> activeTasks = scheduler.getTasks(activeQuery.get());
List<ScheduledTask> liveTasks = SHARD_ID_COMPARATOR.sortedCopy(activeTasks);
template.setAttribute("activeTasks",
ImmutableList.copyOf(
Iterables.transform(offsetAndLimit(liveTasks, offset), taskToStringMap)));
hasMore = hasMore || liveTasks.size() > (offset + PAGE_SIZE);
template.setAttribute("schedulingDetails",
buildSchedulingTable(Iterables.transform(liveTasks, Tasks.SCHEDULED_TO_INFO)));
}
if (completedQuery.isPresent()) {
List<ScheduledTask> completedTasks =
Lists.newArrayList(scheduler.getTasks(completedQuery.get()));
hasMore = completedTasks.size() > (offset + PAGE_SIZE); | 0 |
public static final String HOST_COMPONENT_CLUSTER_NAME_PROPERTY_ID
public static final String HOST_COMPONENT_SERVICE_NAME_PROPERTY_ID
public static final String HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID
public static final String HOST_COMPONENT_DISPLAY_NAME_PROPERTY_ID
public static final String HOST_COMPONENT_HOST_NAME_PROPERTY_ID
public static final String HOST_COMPONENT_STATE_PROPERTY_ID
public static final String HOST_COMPONENT_DESIRED_STATE_PROPERTY_ID
public static final String HOST_COMPONENT_STACK_ID_PROPERTY_ID
public static final String HOST_COMPONENT_DESIRED_STACK_ID_PROPERTY_ID
public static final String HOST_COMPONENT_ACTUAL_CONFIGS_PROPERTY_ID
public static final String HOST_COMPONENT_STALE_CONFIGS_PROPERTY_ID
public static final String HOST_COMPONENT_DESIRED_ADMIN_STATE_PROPERTY_ID
public static final String HOST_COMPONENT_MAINTENANCE_STATE_PROPERTY_ID
public static final String HOST_COMPONENT_HDP_VERSION_PROPERTY_ID
public static final String HOST_COMPONENT_UPGRADE_STATE_PROPERTY_ID = "HostRoles/upgrade_state"; | 1 |
if (uri.isOpaque() && uri.getSchemeSpecificPart() != null)
{
// blueprint:file:/tmp/foo/baa.jar -> file:/tmp/foo/baa.jar
// blueprint:mvn:foo.baa/baa/0.0.1 -> mvn:foo.baa/baa/0.0.1
// wrap:file:/tmp/foo/baa-1.0.jar$Symbolic-Name=baa&Version=1.0 -> file:/tmp/foo/baa-1.0.jar$Symbolic-Name=baa&Version1.0
final String schemeSpecificPart = uri.getSchemeSpecificPart();
// extract content behind the 'file:' protocol of scheme specific path
final int lastIndexOfFileProtocol = schemeSpecificPart.lastIndexOf("file:");
final int offsetFileProtocol = lastIndexOfFileProtocol >= 0 ? lastIndexOfFileProtocol + "file:".length() : 0;
final int firstIndexOfDollar = schemeSpecificPart.indexOf("$");
final int endOfPath = firstIndexOfDollar >= 0 ? firstIndexOfDollar : schemeSpecificPart.length();
// file:/tmp/foo/baa.jar -> /tmp/foo/baa.jar
// mvn:foo.baa/baa/0.0.1 -> mvn:foo.baa/baa/0.0.1
// file:/tmp/foo/baa-1.0.jar$Symbolic-Name=baa&Version=1.0 -> /tmp/foo/baa-1.0.jar
path = schemeSpecificPart.substring(offsetFileProtocol, endOfPath);
}
else
{
// file:/tmp/foo/baa.jar -> /tmp/foo/baa.jar
// mnv:foo.baa/baa/0.0.1 -> foo.baa/baa/0.0.1
path = uri.getPath();
}
// as a meaningful URI or file path. | 0 |
* @since 3.0
* @since 3.1
* @since 3.1 | 0 |
expect(user.getGroups()).andReturn(Collections.emptyList()).anyTimes(); | 0 |
ApiSurface::classesInPackage;
.anyMatch(classMatcher::matches);
final Function<Class<?>, List<Class<?>>> toExposure = checkedApiSurface::getAnyExposurePath;
Maps.<Class<?>, Collection<Class<?>>>newHashMap(), Sets::newHashSet); | 0 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/** Euphoria Java 8 DSL. */
package cz.seznam.euphoria.core.util; | 0 |
package org.apache.felix.karaf.jaas.boot;
public static final String PROPERTY_MODULE = "org.apache.felix.karaf.jaas.module";
public static final String PROPERTY_BUNDLE = "org.apache.felix.karaf.jaas.bundle"; | 0 |
* @deprecated The wrap goal is no longer supported and may be removed in a future release
@Deprecated
getLog().warn( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" );
getLog().warn( "! The wrap goal is no longer supported and may be removed in a future release !" );
getLog().warn( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" );
| 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 |
import org.apache.accumulo.core.client.ClientInfo;
ClientInfo info = ClientInfo.from(c.properties());
final String args[] = {"-i", info.getInstanceName(), "-z", info.getZooKeepers(), "-u", "root",
"-p", ROOT_PASSWORD, "--batchThreads", "2", "--table", tableName, "--num", | 0 |
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.security.cert.X509Certificate;
import javax.xml.parsers.DocumentBuilderFactory;
import org.apache.xml.security.keys.KeyInfo;
import org.apache.xml.security.signature.XMLSignature;
import org.apache.xml.security.utils.Constants;
import org.apache.xml.security.utils.XMLUtils;
import org.w3c.dom.Element; | 0 |
import org.apache.commons.pool2.ObjectPool;
import org.apache.commons.pool2.impl.GenericKeyedObjectPool;
import org.apache.commons.pool2.impl.GenericKeyedObjectPoolFactory;
import org.apache.commons.pool2.impl.GenericObjectPool; | 1 |
this.interpreterSelector = (ServiceSelector) manager.lookup(Interpreter.ROLE + "Selector"); | 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.service;
import java.util.Properties;
public interface CheckService {
public static final String foo = "foo";
public boolean check();
public Properties getProps();
} | 0 |
public void testSearchByDSLReturnsEntity() throws Exception {
//Assert that entity state is set in the result entities
String entityState = rows.getJSONObject(0).getJSONObject("$id$").getString("state");
Assert.assertEquals(entityState, Id.EntityState.ACTIVE.name()); | 0 |
*
* @return explicit parallelism of the runner or -1 if default | 0 |
import org.apache.beam.sdk.transforms.windowing.Triggers;
TriggerStateMachines.stateMachineForTrigger(
Triggers.toProto(strategy.getTrigger()))), | 0 |
protected static final Collection<Capability> capabilities =
Collections.unmodifiableCollection(Arrays.asList(new Capability[] | 0 |
package cz.seznam.euphoria.core.client.operator.state;
/**
* State storage for single value.
*/
public interface ValueStateStorage<T> extends StateStorage<T> {
/** Set the value in this state. */
void set(T value);
/** Retrieve the value. */
T get();
} | 0 |
import org.apache.hc.core5.http2.frame.RawFrame;
final RawFrame frame = new RawFrame(FrameType.DATA.getValue(), 0, 1,
final RawFrame frame2 = inbuffer.read(inputStream);
final ByteBuffer payload2 = frame2.getPayloadContent();
final RawFrame frame1 = inbuffer.read(inputStream);
Assert.assertEquals(8, frame1.getFlags());
final ByteBuffer payload1 = frame1.getPayloadContent();
final RawFrame frame2 = inbuffer.read(inputStream);
Assert.assertEquals(FrameFlag.of(FrameFlag.END_STREAM, FrameFlag.PADDED), frame2.getFlags());
final ByteBuffer payload2 = frame2.getPayloadContent();
final RawFrame frame1 = inbuffer.read(inputStream);
Assert.assertEquals(8, frame1.getFlags());
final ByteBuffer payload1 = frame1.getPayloadContent();
final RawFrame frame2 = inbuffer.read(inputStream);
final ByteBuffer payload2 = frame2.getPayloadContent();
final RawFrame frame3 = inbuffer.read(inputStream);
Assert.assertEquals(FrameFlag.of(FrameFlag.END_STREAM, FrameFlag.PADDED), frame3.getFlags());
final ByteBuffer payload3 = frame3.getPayloadContent();
final RawFrame frame = inbuffer.read(inputStream);
Assert.assertEquals(FrameFlag.of(FrameFlag.END_STREAM, FrameFlag.PADDED), frame.getFlags());
final ByteBuffer payload = frame.getPayloadContent();
final RawFrame frame = inbuffer.read(inputStream);
final ByteBuffer payload = frame.getPayloadContent();
final RawFrame frame = new RawFrame(FrameType.DATA.getValue(), 0, 1, | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/ri/pointers/Attic/DOMAttributePointer.java,v 1.2 2001/09/21 23:22:45 dmitri Exp $
* $Revision: 1.2 $
* $Date: 2001/09/21 23:22:45 $
* @version $Revision: 1.2 $ $Date: 2001/09/21 23:22:45 $
return new QName(DOMNodePointer.getPrefix(attr), DOMNodePointer.getLocalName(attr));
public QName getExpandedName(){
return new QName(getNamespaceURI(), DOMNodePointer.getLocalName(attr));
public String getNamespaceURI(){
String prefix = DOMNodePointer.getPrefix(attr);
if (prefix == null){
return null;
}
return parent.getNamespaceURI(prefix);
public boolean testNode(NodeTest nodeTest){
return nodeTest == null ||
((nodeTest instanceof NodeTypeTest) &&
((NodeTypeTest)nodeTest).getNodeType() == Compiler.NODE_TYPE_NODE);
}
buffer.append(getName()); | 0 |
import java.awt.geom.Point2D;
Point2D offset, | 0 |
void setStackId(StackId stackId);
| 0 |
tableNamespaceOpt = new Option(Shell.tableNamespaceOption, "table-namespace", true, "table namespace to display/set/delete properties for"); | 0 |
/**
* @param opts The FileSystemOptions.
* @return The encoding.
* @since 2.0
* */ | 0 |
import org.apache.beam.sdk.transforms.DoFn;
public DoFn<InputT, OutputT> getFn() {
return delegate.getFn();
}
@Override | 0 |
public BundleContext getBundleContext();
| 0 |
return new DefaultHttpRoutePlanner
(getConnectionManager().getSchemeRegistry()); | 0 |
BlueprintResourceProvider.init(injector.getInstance(BlueprintDAO.class), injector.getInstance(Gson.class)); | 0 |
* <p>The source is a wrapper over the {@code BigQueryTableRowIterator} class, which issues a | 0 |
private String stackRevision; | 0 |
@Mock(type = MockType.NICE)
private ClusterTopology clusterTopologyMock;
requestStatusResponse, executor, persistedState, clusterTopologyMock, mockFuture, settingDAO);
requestStatusResponse, executor, persistedState, clusterTopologyMock, mockFuture, settingDAO);
public void testAddKerberosClientAtTopologyInit() throws Exception {
Map<ClusterTopology, List<LogicalRequest>> allRequests = new HashMap<>();
List<LogicalRequest> requestList = new ArrayList<>();
requestList.add(logicalRequest);
expect(logicalRequest.hasCompleted()).andReturn(true).anyTimes();
allRequests.put(clusterTopologyMock, requestList);
expect(requestStatusResponse.getTasks()).andReturn(Collections.<ShortTaskStatus>emptyList()).anyTimes();
expect(clusterTopologyMock.isClusterKerberosEnabled()).andReturn(true);
expect(clusterTopologyMock.getClusterId()).andReturn(CLUSTER_ID).anyTimes();
expect(clusterTopologyMock.getBlueprint()).andReturn(blueprint).anyTimes();
expect(persistedState.getAllRequests()).andReturn(allRequests).anyTimes();
expect(persistedState.getProvisionRequest(CLUSTER_ID)).andReturn(logicalRequest).anyTimes();
expect(ambariContext.isTopologyResolved(CLUSTER_ID)).andReturn(true).anyTimes();
expect(group1.addComponent("KERBEROS_CLIENT")).andReturn(true);
expect(group2.addComponent("KERBEROS_CLIENT")).andReturn(true);
replayAll();
topologyManager.provisionCluster(request);
//todo: assertions
}
@Test
persistedState, clusterTopologyMock, securityConfigurationFactory, credentialStoreService,
clusterController, resourceProvider, mockFuture, requestStatusResponse, logicalRequest, settingDAO); | 0 |
if (serviceName != null) {
try {
Service service = cluster.getService(serviceName);
stackId = service.getDesiredStackId();
} catch (AmbariException e) {
LOG.debug("Could not load service {}, skipping topology check", serviceName);
}
if (stackId == null) {
stackId = cluster.getDesiredStackVersion();
} | 1 |
import cz.seznam.euphoria.core.annotation.audience.Audience;
@Audience(Audience.Type.INTERNAL)
| 0 |
auths = new ArrayList<>();
ArrayList<Value> values = new ArrayList<>(); | 0 |
package org.apache.accumulo.monitor.util.celltypes;
import org.apache.accumulo.core.master.thrift.BulkImportState;
public class BulkImportStateType extends CellType<BulkImportState> {
private static final long serialVersionUID = 1L;
@Override
public String alignment() {
return "left";
}
@Override
public String format(Object obj) {
BulkImportState state = (BulkImportState)obj;
return state.name();
}
@Override
public int compare(BulkImportState o1, BulkImportState o2) {
if (o1 == null && o2 == null)
return 0;
else if (o1 == null)
return -1;
return o1.compareTo(o2);
}
} | 1 |
BookieServer server = new BookieServer(initialPort + 3, HOSTPORT, tmpDirs.get(3), new File[] { tmpDirs.get(3)}); | 0 |
return new ZooArbitrator(ServerContext.getInstance()); | 0 |
LinkOption[] options = IoUtils.getLinkOptions(true); | 0 |
package org.apache.hc.core5.reactor; | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.