Diff
stringlengths 5
2k
| FaultInducingLabel
int64 0
1
|
---|---|
@Deprecated
| 0 |
import com.google.gson.GsonBuilder;
private final Gson prettyGson = new GsonBuilder().serializeNulls().setPrettyPrinting().create();
bind(Gson.class).annotatedWith(Names.named("prettyGson")).toInstance(prettyGson);
| 0 |
/**
* @throws Exception
*/
// put the unhealthy host into MM which will allow this check to pass
Assert.assertEquals(PrereqCheckStatus.PASS, check.getStatus());
// make the host healthy and take it out of MM to produce a PASS result
| 0 |
import org.apache.beam.runners.direct.DirectGroupByKey.DirectGroupAlsoByWindow;
import org.apache.beam.runners.direct.DirectGroupByKey.DirectGroupByKeyOnly;
.put(DirectGroupByKeyOnly.class, new GroupByKeyOnlyEvaluatorFactory())
.put(DirectGroupAlsoByWindow.class, new GroupAlsoByWindowEvaluatorFactory())
EvaluationContext evaluationContext)
| 0 |
.onResultOf(o -> o.getUnavailabilityStart().orElse(Instant.MAX));
| 0 |
* Do some runner setup: check that the DirectRunner is not used in conjunction with
// such as EvaluationResults returned by DirectRunner.
| 0 |
// Add instance name & factory name
addProperty(new Property(this, "instance.name", handler.getInstanceManager().getInstanceName()));
addProperty(new Property(this, "factory.name", handler.getInstanceManager().getFactory().getName()));
* service. To avoid cycle in Check Context, the registered service is set to
* registered before the real registration.
m_serviceRegistration.unregister();
| 0 |
* @cocoon.sitemap.component.documentation
| 0 |
guid = repositoryService.createEntity(hrDept2);
String dbGUID = repositoryService.createEntity(db);
String tableGUID = repositoryService.createEntity(table);
| 0 |
import cz.seznam.euphoria.core.client.dataset.BatchWindowing;
public class MapWindow<IN, OUT, W extends Window<?>>
extends WindowWiseOperator<IN, IN, OUT, W> {
public <W extends Window<?>> MapWindow<IN, OUT, W> windowBy(
MapWindow<IN, OUT, W> mapWindow = new MapWindow<>(flow, input, windowing);
public Dataset<OUT> output() {
return windowBy(BatchWindowing.get()).output();
}
private final Dataset<OUT> output;
public Dataset<OUT> output() {
| 0 |
import static java.nio.charset.StandardCharsets.UTF_8;
@Test
public void testReverse() throws Exception {
Schema resultType = Schema.builder().addByteArrayField("field").build();
Row resultRow = Row.withSchema(resultType).addValues("дгвба".getBytes(UTF_8)).build();
Row resultRow2 = Row.withSchema(resultType).addValues("\1\0".getBytes(UTF_8)).build();
Row resultRow3 = Row.withSchema(resultType).addValues("".getBytes(UTF_8)).build();
String sql = "SELECT REVERSE(f_bytes) FROM PCOLLECTION";
PCollection<Row> result = boundedInputBytes.apply("testUdf", SqlTransform.query(sql));
PAssert.that(result).containsInAnyOrder(resultRow, resultRow2, resultRow3);
pipeline.run().waitUntilFinish();
}
| 0 |
import org.apache.ambari.server.orm.dao.RepositoryVersionDAO;
@Inject
private Provider<RepositoryVersionDAO> repositoryVersionDAO;
/**
* When hosts are added, add a host_version record for every repo_version in the database.
*
* @param event the add event
*/
List<RepositoryVersionEntity> repos = repositoryVersionDAO.get().findAllDefinitions();
for (String hostName : event.getHostNames()) {
HostEntity hostEntity = hostDAO.get().findByName(hostName);
for (RepositoryVersionEntity repositoryVersion : repos) {
// we don't have the knowledge yet to know if we need the record
HostVersionEntity missingHostVersion = new HostVersionEntity(hostEntity,
repositoryVersion, RepositoryVersionState.NOT_REQUIRED);
LOG.info("Creating host version for {}, state={}, repo={} (repo_id={})",
missingHostVersion.getHostName(), missingHostVersion.getState(),
missingHostVersion.getRepositoryVersion().getVersion(), missingHostVersion.getRepositoryVersion().getId());
hostVersionDAO.get().create(missingHostVersion);
* Host repo_version entities are removed via cascade.
| 0 |
File testInstanceId = new File(
new File(new File(new File("target"), "instanceTest"), ServerConstants.INSTANCE_ID_DIR),
UUID.fromString("00000000-0000-0000-0000-000000000000").toString());
assertTrue(
testInstanceId.getParentFile().mkdirs() || testInstanceId.getParentFile().isDirectory());
File testInstanceVersion = new File(
new File(new File(new File("target"), "instanceTest"), ServerConstants.VERSION_DIR),
ServerConstants.DATA_VERSION + "");
assertTrue(testInstanceVersion.getParentFile().mkdirs()
|| testInstanceVersion.getParentFile().isDirectory());
EasyMock.expect(inst.getInstanceID())
.andReturn(UUID.nameUUIDFromBytes(new byte[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 0}).toString())
.anyTimes();
* This is a test to ensure the string literal in
* {@link ConnectorImpl#ConnectorImpl(org.apache.accumulo.core.client.impl.ClientContext)} is kept
* up-to-date if we move the {@link SystemToken}<br>
assertEquals("org.apache.accumulo.server.security.SystemCredentials$SystemToken",
SystemToken.class.getName());
| 0 |
* @version $Id: TestEqualBehaviour.java,v 1.3 2004/01/16 14:23:39 epugh Exp $
public class TestEqualBehaviour extends TestCase
public void testLoading() throws Exception
public void testDeletingExisting() throws Exception
public void testDeletingNonExisting() throws Exception
public void testSettingNonExisting() throws Exception
public void testSettingExisting() throws Exception
public void testAddingUnset() throws Exception
public void testAddingSet() throws Exception
| 0 |
* Copyright 2001-2005 The Apache Software Foundation
| 0 |
log.trace(String.format("tservers per batch : %,8.2f avg %,6d min %,6d max",
(float) (numBatches.get() != 0 ? (tabletServersBatchSum.get() / numBatches.get()) : 0), minTabletServersBatch.get(), maxTabletServersBatch.get()));
log.trace(String.format("tablets per batch : %,8.2f avg %,6d min %,6d max",
(float) (numBatches.get() != 0 ? (tabletBatchSum.get() / numBatches.get()) : 0), minTabletBatch.get(), maxTabletBatch.get()));
| 0 |
private final ClientContext context;
public TabletServerBatchWriter(ClientContext context, BatchWriterConfig config) {
this.context = context;
Tables.clearCache(context.getInstance());
if (!Tables.exists(context.getInstance(), tableId))
throw new MutationsRejectedException(context.getInstance(), cvsList, af, serverSideErrors, unknownErrors, lastUnknownError);
ret = TabletLocator.getLocator(context, new Text(tableId));
locator.binMutations(context, tableMutations, binnedMutations, tableFailures);
if (!Tables.exists(context.getInstance(), entry.getKey()))
else if (Tables.getTableState(context.getInstance(), table) == TableState.OFFLINE)
throw new TableOfflineException(context.getInstance(), entry.getKey());
TabletLocator.getLocator(context, new Text(table)).invalidateCache(context.getInstance(), location);
if (timeoutTracker.getTimeOut() < context.getClientTimeoutInMillis())
client = ThriftUtil.getTServerClient(location, context, timeoutTracker.getTimeOut());
client = ThriftUtil.getTServerClient(location, context);
client.update(tinfo, context.rpcCreds(), entry.getKey().toThrift(), entry.getValue().get(0).toThrift(), DurabilityImpl.toThrift(durability));
TabletLocator.getLocator(context, new Text(entry.getKey().getTableId())).invalidateCache(entry.getKey());
long usid = client.startUpdate(tinfo, context.rpcCreds(), DurabilityImpl.toThrift(durability));
TabletLocator.getLocator(context, new Text(table)).invalidateCache(failedExtent);
| 1 |
Copyright 2003 The Apache Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
| 0 |
* href="http://commons.apache.org/configuration/team-list.html">Commons
* <code><a href="http://commons.apache.org/lang/api-release/org/apache/commons/lang/ClassUtils.html">
| 0 |
} catch (Exception e) {
handleException(e);
throws ProcessingException {
if (this.data != null) {
if (this.data != null) {
// Capture environment info
this.data.setEnvironmentInfo(new EnvironmentInfo(environment));
// Execute pipeline
long time = System.currentTimeMillis();
boolean result = super.processReader(environment);
this.data.setTotalTime(System.currentTimeMillis()-time);
// Report
profiler.addResult(environment.getURI(), this.data);
return result;
} else {
getLogger().warn("Profiler Data havn't any components to measure");
return super.processReader(environment);
| 0 |
public static Path getRecoveryPath(VolumeManager fs, Path walPath) {
| 0 |
import java.util.Optional;
| 0 |
import org.apache.beam.runners.core.triggers.ExecutableTriggerStateMachine;
import org.apache.beam.runners.core.triggers.TriggerStateMachineContextFactory;
import org.apache.beam.runners.core.triggers.TriggerStateMachineRunner;
* <p>The {@link #onTrigger} relies on a {@link TriggerStateMachineRunner} to manage the execution
* of the triggering logic. The {@code ReduceFnRunner}s responsibilities are:
* <li>Tracking the windows that are active (have buffered data) as elements arrive and triggers are
* fired.
* <li>Holding the watermark based on the timestamps of elements in a pane and releasing it when the
* trigger fires.
* firings, etc, and providing appropriate contexts to the {@link ReduceFn} for actions such as
* output.
* happen when the appropriate timer fires.
* @param <K> The type of key being processed.
* @param <InputT> The type of values associated with the key.
* @param <W> The type of windows this operates on.
private final TriggerStateMachineRunner<W> triggerRunner;
ExecutableTriggerStateMachine triggerStateMachine,
new TriggerStateMachineRunner<>(
triggerStateMachine,
new TriggerStateMachineContextFactory<>(
| 0 |
pgpKeyId = XMLUtils.decode(content);
pgpKeyPacket = XMLUtils.decode(content);
| 0 |
public void testLoadXMLWithSettings() throws Exception
| 0 |
* Key used to retrieve the value of the disconnect timeout which
* is used when a disconnection is attempted. If the disconnect
* message has not been sent before the timeout, the underlying socket
* will be forcibly closed.
*/
public static final String DISCONNECT_TIMEOUT = "disconnect-timeout";
/**
| 0 |
*
* @version $Id$
public FileCacheSeekableStream(InputStream stream)
* Returns the current offset in this file.
* Sets the file-pointer offset, measured from the beginning of this
* @param pos the offset position, measured in bytes from the
* beginning of the file, at which to set the file
* @exception IOException if <code>pos</code> is less than
| 0 |
* DOMImplementation#createDocument(String,String,DocumentType)}.
| 1 |
package com.twitter.mesos.scheduler.state;
import com.twitter.mesos.scheduler.MesosTaskFactory;
| 0 |
* @version CVS $Id: XSPSessionFwHelper.java,v 1.7 2003/12/26 23:47:50 antonio Exp $
DocumentFragment df = getXML(cm, context, path);
return df != null ? df.getFirstChild().getNodeValue() : "";
| 0 |
try (BatchWriter bw = client.createBatchWriter("table1")) {
Mutation m1 = new Mutation("00081");
m1.put("math", "sqroot", "9");
m1.put("math", "sq", "6560");
bw.addMutation(m1);
}
try (BatchWriter bw = client.createBatchWriter(table)) {
Mutation m = new Mutation("foo");
m.put("cf", "cq", "value");
bw.addMutation(m);
}
| 0 |
import static org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration.TIMELINE_METRICS_EVENT_METRIC_PATTERNS;
import static org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.aggregators.AggregatorUtils.getJavaRegexFromSqlRegex;
import java.util.HashSet;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
for (String patternString : filteredMetricPatterns.split(",")) {
String javaPatternString = getJavaRegexFromSqlRegex(patternString);
skipAggrPatternStrings.add(javaPatternString);
}
| 0 |
public static int determineJRELevel() {
final String s = System.getProperty("java.version");
final String[] parts = s.split("\\.");
if (parts.length > 0) {
try {
final int majorVersion = Integer.parseInt(parts[0]);
if (majorVersion > 1) {
return majorVersion;
} else if (majorVersion == 1 && parts.length > 1) {
return Integer.parseInt(parts[1]);
}
} catch (final NumberFormatException ignore) {
}
}
return 7;
}
| 0 |
package org.apache.commons.fileupload2;
import org.apache.commons.fileupload2.DefaultFileItem;
import org.apache.commons.fileupload2.DefaultFileItemFactory;
import org.apache.commons.fileupload2.FileItem;
import org.apache.commons.fileupload2.FileItemFactory;
* Unit tests for {@link org.apache.commons.fileupload2.DefaultFileItem}.
| 0 |
import org.apache.aurora.common.application.AppLauncher;
| 0 |
private Profile profile;
PortalService service) {
* @see org.apache.cocoon.portal.profile.ProfileManagerAspectContext#invokeNext(org.apache.cocoon.portal.scratchpad.Profile)
public void invokeNext(Profile profile) {
this.profile = profile;
public Profile getProfile() {
return this.profile;
}
| 0 |
import org.apache.beam.sdk.io.common.NetworkTestHelper;
public static void beforeClass() throws Exception {
port = NetworkTestHelper.getAvailableLocalPort();
public static void afterClass() {
| 0 |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.StringTokenizer;
| 0 |
import org.apache.accumulo.core.util.MetadataTable;
MetadataTable.PREV_ROW_COLUMN.fetch(scanner);
MetadataTable.DIRECTORY_COLUMN.fetch(scanner);
if (!MetadataTable.PREV_ROW_COLUMN.hasColumns(prevEndRowKey)) {
if (!returnPrevEndRow && MetadataTable.PREV_ROW_COLUMN.hasColumns(entry.getKey())) {
if (!returnDir && MetadataTable.DIRECTORY_COLUMN.hasColumns(entry.getKey())) {
if (MetadataTable.PREV_ROW_COLUMN.hasColumns(entry.getKey())) {
log.info("Resetting " + MetadataTable.NAME + " scanner to " + range);
| 0 |
import org.apache.ambari.server.security.authorization.ResourceType;
String typeName = privilegeEntity.getResource().getResourceType().getName();
if (ResourceType.CLUSTER.name().equalsIgnoreCase(typeName)) {
privilegeType = ResourceType.CLUSTER.name();
} else if (ResourceType.AMBARI.name().equalsIgnoreCase(typeName)) {
privilegeType = ResourceType.AMBARI.name();
} else {
privilegeType = ResourceType.VIEW.name();
| 0 |
m_metadataHolder = injector.getProvider(MetadataHolder.class);
m_agentConfigsHolder = injector.getProvider(AgentConfigsHolder.class);
| 0 |
* Copyright (C) 2015 Google Inc.
| 0 |
* .apply(Combine.perKey(yourCombineFn))
| 0 |
import org.apache.beam.vendor.grpc.v1_13_1.com.google.protobuf.ByteString;
| 0 |
IOReactorConfig config = new IOReactorConfig();
config.setIoThreadCount(1);
final ListeningIOReactor ioreactor = new DefaultListeningIOReactor(config);
IOReactorConfig config = new IOReactorConfig();
config.setIoThreadCount(1);
final ListeningIOReactor ioreactor = new DefaultListeningIOReactor(config);
IOReactorConfig config = new IOReactorConfig();
config.setIoThreadCount(1);
final DefaultListeningIOReactor ioreactor = new DefaultListeningIOReactor(config);
| 0 |
@Override
| 0 |
import com.twitter.mesos.gen.ScheduledTask;
import com.twitter.mesos.scheduler.storage.Storage;
private final Storage storage;
* @param storage Backing store to fetch tasks from.
Storage storage,
this.storage = checkNotNull(storage);
Set<ScheduledTask> tasks = Storage.Util.fetchTasks(storage, Query.GET_ALL);
for (TwitterTaskInfo task : Iterables.transform(tasks, Tasks.SCHEDULED_TO_INFO)) {
| 0 |
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final Logger LOG = LoggerFactory.getLogger(PortAssignment.class);
| 0 |
*
*
*
*
*
| 0 |
import java.util.Arrays;
| 0 |
import org.apache.beam.runners.core.TimerInternals;
| 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.http.conn.routing.HttpRoute;
| 0 |
public static final class BouncyCastleRandomFactory implements RandomFactory {
public BouncyCastleRandomFactory() {
public static final class BouncyCastleRandom extends AbstractRandom {
BouncyCastleRandom() {
| 0 |
this.value = JXTExpression.compileExpr(select, "eval: \"select\":", getLocation());
| 0 |
import org.apache.commons.vfs.FileContent;
import org.apache.commons.vfs.FileType;
* @version $Revision: 1.5 $ $Date: 2003/01/21 02:42:29 $
/**
* Asserts that the content of a file is the same as expected. Checks the
* length reported by getSize() is correct, then reads the content as
* a byte stream and compares the result with the expected content.
* Assumes files are encoded using UTF-8.
*/
protected void assertSameContent( final String expected,
final FileObject file )
throws Exception
{
// Check the file exists, and is a file
assertTrue( file.exists() );
assertSame( FileType.FILE, file.getType() );
// Get file content as a binary stream
final byte[] expectedBin = expected.getBytes( "utf-8" );
// Check lengths
final FileContent content = file.getContent();
assertEquals( "same content length", expectedBin.length, content.getSize() );
// Read content into byte array
final InputStream instr = content.getInputStream();
final ByteArrayOutputStream outstr;
try
{
outstr = new ByteArrayOutputStream();
final byte[] buffer = new byte[ 256 ];
int nread = 0;
while ( nread >= 0 )
{
outstr.write( buffer, 0, nread );
nread = instr.read( buffer );
}
}
finally
{
instr.close();
}
// Compare
assertTrue( "same binary content", Arrays.equals( expectedBin, outstr.toByteArray() ) );
}
| 0 |
* Common HTTP methods using {@link HttpUriRequest} as a HTTP request message representation.
* @since 5.0
| 0 |
private static final String[] COLLECTION = new String[] {
private static final List<KV<Integer, String>> WITH_KEYS = Arrays.asList(
private static final List<KV<Integer, String>> WITH_CONST_KEYS = Arrays.asList(
private static final List<KV<Void, String>> WITH_CONST_NULL_KEYS = Arrays.asList(
KV.of((Void) null, "a"),
KV.of((Void) null, "aa"),
KV.of((Void) null, "b"),
KV.of((Void) null, "bb"),
KV.of((Void) null, "bbb")
);
@Category(NeedsRunner.class)
public void testConstantVoidKeys() {
PCollection<String> input =
p.apply(Create.of(Arrays.asList(COLLECTION)).withCoder(
StringUtf8Coder.of()));
PCollection<KV<Void, String>> output =
input.apply(WithKeys.<Void, String>of((Void) null));
PAssert.that(output)
.containsInAnyOrder(WITH_CONST_NULL_KEYS);
p.run();
}
@Test
| 0 |
*
@XmlType(name = "", propOrder = {"responseId","timestamp",
this.hardwareProfile = hardwareProfile;
| 0 |
import java.lang.reflect.InvocationTargetException;
} catch (IllegalArgumentException e) {
log.error("Signature of sync method changed. Accumulo is likely incompatible with this version of Hadoop.");
throw new RuntimeException(e);
} catch (IllegalAccessException e) {
log.error("Could not invoke sync method due to permission error.");
throw new RuntimeException(e);
} catch (InvocationTargetException e) {
Throwable cause = e.getCause();
if (cause instanceof IOException) {
throw (IOException) cause;
} else if (cause instanceof RuntimeException) {
throw (RuntimeException) cause;
} else if (cause instanceof Error) {
throw (Error) cause;
} else {
// Cause is null, or some other checked exception that was added later.
throw new RuntimeException(e);
}
| 0 |
stackId.getStackVersion(), "admin", RepositoryVersionState.INSTALLING);
| 0 |
public class PoolingConnection extends DelegatingConnection<Connection>
| 0 |
.include("source", source);
builder.delegate(source);
| 0 |
import org.apache.sshd.server.Environment;
public void start(Environment env) throws IOException {
this.env = Collections.unmodifiableMap(env.getEnv());
IoUtils.closeQuietly(in, out, err);
| 0 |
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
import org.apache.accumulo.minicluster.impl.ProcessReference;
public void configure(MiniAccumuloConfigImpl cfg) {
| 0 |
* @version CVS $Id: DefaultSelectionListBuilder.java,v 1.3 2003/12/10 17:53:26 vgritsenko Exp $
Object value;
if ("".equals(stringValue)) {
// Empty value translates into the null object
value = null;
} else {
value = convertor.convertFromString(stringValue, Locale.US, formatCache);
if (value == null) {
throw new Exception("Could not convert the value \"" + stringValue +
"\" to the type " + datatype.getDescriptiveName() +
", defined at " + DomHelper.getLocation(element));
}
}
| 0 |
/* ====================================================================
* Copyright (c) 2001-2004 The Apache Software Foundation. All rights
* @version $Revision: 1.3 $ $Date: 2004/01/14 21:34:35 $
| 0 |
* Constructs a key.
| 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.beam.sdk.coders;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
/** Tests for {@link BooleanCoder}. */
@RunWith(JUnit4.class)
public class BooleanCoderTest {
private static final Coder<Boolean> TEST_CODER = BooleanCoder.of();
@Test
public void testStructuralValueReturnTheSameValue() {
Boolean expected = Boolean.TRUE;
Object actual = TEST_CODER.structuralValue(expected);
assertEquals(expected, actual);
}
}
| 0 |
package org.apache.commons.net.examples.nntp;
| 0 |
try {
instanceDefinitions.add(createViewInstanceDefinition(viewDefinition, instanceConfig));
} catch (Exception e) {
LOG.error("Caught exception adding view instance for view " +
viewDefinition.getViewName(), e);
}
* Install the given view instance with its associated view.
*
* @throws IllegalStateException if the given instance is not in a valid state
* @throws IllegalArgumentException if the view associated with the given instance
* does not exist
public void installViewInstance(ViewInstanceEntity instanceEntity)
throws IllegalStateException, IllegalArgumentException {
instanceEntity.validate(viewEntity);
} catch (Exception e) {
String message = "Caught exception installing view instance.";
LOG.error(message, e);
throw new IllegalStateException(message, e);
// update the registry
addInstanceDefinition(viewEntity, instanceEntity);
*
* @throws IllegalStateException if the given instance is not in a valid state
public void updateViewInstance(ViewInstanceEntity instanceEntity)
throws IllegalStateException {
instanceEntity.validate(viewEntity);
throws ClassNotFoundException, IllegalStateException {
viewInstanceDefinition.validate(viewDefinition);
protected void bindViewInstance(ViewEntity viewDefinition,
| 0 |
public int available() throws IOException
{
long available = raf.length() - raf.getFilePointer();
if (available > Integer.MAX_VALUE)
{
return Integer.MAX_VALUE;
}
return (int) available;
}
| 0 |
String s = System.getProperty("http.keepAlive", "true");
String s = System.getProperty("http.keepAlive", "true");
| 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 |
* @version $Id: TestXMLConfiguration.java,v 1.14 2004/10/11 09:26:38 henning Exp $
conf.setFileName("subdir/hello.xml");
assertEquals("subdir/hello.xml", conf.getFileName());
assertEquals(new File(testBasePath, "subdir/hello.xml"), conf.getFile());
| 0 |
import org.apache.ambari.server.orm.entities.UserAuthenticationEntity;
import org.apache.ambari.server.orm.entities.UserEntity;
UserEntity userEntity = createMock(UserEntity.class);
expect(userEntity.getAuthenticationEntities()).andReturn(Collections.<UserAuthenticationEntity>emptyList()).once();
expect(users.getUserEntity("test-user")).andReturn(userEntity).once();
| 0 |
void setConverter(Converter c);
InternalConverting key(Object key);
| 0 |
package org.apache.commons.jxpath.issues;
| 0 |
Filter.propertyFilter("sso", true),
Filter.propertyFilter("authenticated", true),
| 0 |
import org.apache.xml.security.exceptions.XMLSecurityException;
| 0 |
// Cannot use forEach because of the modification of the updated map value (non-final)
// Cannot use forEach because of the IOException being thrown by appendNonEmptyProperty
| 0 |
@Ignore(
"TODO: BEAM-2902 Add support for user state in a ParDo.Multi once PTransformMatcher "
+ "exposes a way to know when the replacement is not required by checking that the "
+ "preceding ParDos to a GBK are key preserving.")
private static DataflowPipelineOptions buildPipelineOptions(String... args) throws IOException {
| 1 |
import org.apache.accumulo.core.file.rfile.PrintInfo;
String result = FunctionalTestUtils.readAll(url.openStream());
Process info = cluster.exec(PrintInfo.class, entry.getKey().getColumnQualifier().toString());
String out = FunctionalTestUtils.readAll(cluster, PrintInfo.class, info);
bscanner.close();
| 0 |
/** Produces a {@link RunnerApi.CombinePayload} from a {@link Combine}. */
GlobalCombineFn<?, ?, ?> combineFn = combine.getTransform().getFn();
try {
return RunnerApi.CombinePayload.newBuilder()
.setAccumulatorCoderId(
components.registerCoder(
extractAccumulatorCoder(combineFn, (AppliedPTransform) combine)))
.setCombineFn(
SdkFunctionSpec.newBuilder()
.setEnvironmentId(
components.registerEnvironment(Environments.JAVA_SDK_HARNESS_ENVIRONMENT))
.setSpec(
FunctionSpec.newBuilder()
.setUrn(JAVA_SERIALIZED_COMBINE_FN_URN)
.setPayload(
ByteString.copyFrom(
SerializableUtils.serializeToByteArray(
combine.getTransform().getFn())))
.build())
.build())
} catch (CannotProvideCoderException e) {
throw new IllegalArgumentException(e);
throw new IllegalArgumentException(e);
| 0 |
import static org.apache.beam.sdk.util.CoderUtils.encodeToByteArray;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
| 0 |
void delete() throws MutationsRejectedException, TableNotFoundException;
| 0 |
import java.util.Map;
import org.osgi.util.converter.ConversionException;
import org.osgi.util.converter.TypeReference;
@Override
default public boolean equals(Object o1, Object o2) {
try {
Map<String, Object> m1 = convert(o1).to(new TypeReference<Map<String,Object>>(){});
Map<String, Object> m2 = convert(o2).to(new TypeReference<Map<String,Object>>(){});
if (m1.size() != m2.size())
return false;
for (Map.Entry<String, Object> entry : m1.entrySet()) {
Object val = m2.get(entry.getKey());
if (!equals(entry.getValue(), val))
return false;
}
return true;
} catch (ConversionException e) {
// do lists as well
// It's a scalar - compare via strings
String s1 = convert(o1).to(String.class);
String s2 = convert(o2).to(String.class);
return s1.equals(s2);
}
}
| 0 |
import java.util.Collection;
Iterable<? extends Map.Entry<PublicKey, String>> keys = client.getIdentities();
assertObjectInstanceOf("Non collection initial identities", Collection.class, keys);
assertEquals("Unexpected initial identities size", 0, ((Collection<?>) keys).size());
assertObjectInstanceOf("Non collection registered identities", Collection.class, keys);
assertEquals("Mismatched registered keys size", 1, ((Collection<?>) keys).size());
assertObjectInstanceOf("Non collection removed identities", Collection.class, keys);
assertEquals("Registered keys size not empty", 0, ((Collection<?>) keys).size());
| 0 |
* @author <a href="mailto:[email protected]">Felix Project Team</a>
| 0 |
String[] atlasEndpoint = atlasConf.getStringArray(ATLAS_ENDPOINT);
if (atlasEndpoint == null){
atlasEndpoint = new String[]{DEFAULT_DGI_URL};
}
atlasClient = new AtlasClient(atlasEndpoint, basicAuthUsernamePassword);
| 0 |
if (this.status.get().compareTo(IOReactorStatus.SHUTTING_DOWN) == 0 && this.selector.keys().isEmpty()) {
break;
if (this.status.compareAndSet(IOReactorStatus.INACTIVE, IOReactorStatus.SHUT_DOWN)) {
synchronized (this.shutdownMutex) {
this.shutdownMutex.notifyAll();
}
} else if (this.status.compareAndSet(IOReactorStatus.ACTIVE, IOReactorStatus.SHUTTING_DOWN)) {
this.selector.wakeup();
final IOReactorStatus previousStatus = this.status.getAndSet(IOReactorStatus.SHUT_DOWN);
if (previousStatus.compareTo(IOReactorStatus.ACTIVE) == 0) {
this.selector.wakeup();
}
synchronized (this.shutdownMutex) {
this.shutdownMutex.notifyAll();
}
| 0 |
import org.apache.batik.util.SVGTypes;
// ExtendedTraitAccess ///////////////////////////////////////////////////
/**
* Returns the type of the given attribute.
*/
public int getAttributeType(String ns, String ln) {
if (ns == null) {
if (ln.equals(SVG_ACCUMULATE_ATTRIBUTE)
|| ln.equals(SVG_ADDITIVE_ATTRIBUTE)
|| ln.equals(SVG_ATTRIBUTE_TYPE_ATTRIBUTE)
|| ln.equals(SVG_CALC_MODE_ATTRIBUTE)
|| ln.equals(SVG_FILL_ATTRIBUTE)
|| ln.equals(SVG_RESTART_ATTRIBUTE)) {
return SVGTypes.TYPE_IDENT;
} else if (ln.equals(SVG_ATTRIBUTE_NAME_ATTRIBUTE)
|| ln.equals(SVG_BY_ATTRIBUTE)
|| ln.equals(SVG_FROM_ATTRIBUTE)
|| ln.equals(SVG_MAX_ATTRIBUTE)
|| ln.equals(SVG_MIN_ATTRIBUTE)
|| ln.equals(SVG_TO_ATTRIBUTE)
|| ln.equals(SVG_VALUES_ATTRIBUTE)) {
return SVGTypes.TYPE_CDATA;
} else if (ln.equals(SVG_BEGIN_ATTRIBUTE)
|| ln.equals(SVG_END_ATTRIBUTE)) {
return SVGTypes.TYPE_TIMING_SPECIFIER_LIST;
} else if (ln.equals(SVG_DUR_ATTRIBUTE)
|| ln.equals(SVG_REPEAT_DUR_ATTRIBUTE)) {
return SVGTypes.TYPE_TIME;
} else if (ln.equals(SVG_KEY_SPLINES_ATTRIBUTE)
|| ln.equals(SVG_KEY_TIMES_ATTRIBUTE)) {
return SVGTypes.TYPE_NUMBER_LIST;
} else if (ln.equals(SVG_REPEAT_COUNT_ATTRIBUTE)) {
return SVGTypes.TYPE_INTEGER;
}
}
return super.getAttributeType(ns, ln);
}
| 1 |
updaterAssert("header-None", "col-entity-None");
updaterAssert("header-Tx-prop-T1-No-Guid", "col-entity-T1-prop-Tn-No-Guid",
PROCESS_DELETE + ":Tn",
PROCESS_UPDATE + ":T1",
PROCESS_ADD + ":Tx");
| 0 |
collector.add(new EventInfo(event.getTopic(), null, null, props));
| 0 |
* @version CVS $Id: EPRight.java,v 1.3 2003/09/05 07:31:40 cziegeler Exp $
| 0 |
import org.apache.ambari.server.configuration.AmbariServerConfigurationCategory;
| 0 |
import org.apache.beam.runners.core.StepContext;
| 0 |
import org.apache.beam.sdk.util.state.StateInternalsFactory;
private final StateInternalsFactory<K> stateInternalsFactory;
StateInternalsFactory<K> stateInternalsFactory,
this.stateInternalsFactory = stateInternalsFactory;
StateInternals<K> stateInternals = stateInternalsFactory.stateInternalsForKey(key);
| 0 |
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.annotations.VisibleForTesting;
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Supplier;
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Iterables;
| 0 |
@Deprecated
| 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.