id
stringlengths
23
26
content
stringlengths
182
2.49k
codereview_java_data_10082
.region(region) .build(); - getActivites(sfnClient); sfnClient.close(); } // snippet-start:[stepfunctions.java2.list_activities.main] - public static void getActivites(SfnClient sfnClient) { try { ListActivitiesRequest activitiesReques...
codereview_java_data_10085
update(getQueryMetrics(projectName), sqlResponse); String cube = sqlResponse.getCube(); - if (cube == null) { return; } String cubeName = cube.replace("=", "->"); It's better use `StringUtils.isEmpty(cube)` to check. update(getQueryMetrics(projectName),...
codereview_java_data_10098
public String getMessage() { return message; } - - public String registrationSecret() { - return registrationSecret; - } } -} \ No newline at end of file Why is this in the result? It seems like it shouldn't be needed there, as the value will already have been used. public String g...
codereview_java_data_10100
types.add(Proxy.Type.DIRECT.name()); types.add(Proxy.Type.HTTP.name()); - if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) types.add(Proxy.Type.SOCKS.name()); ArrayAdapter<String> adapter = new ArrayAdapter<>(context, android.R.layout.simple_spin...
codereview_java_data_10102
@SuppressWarnings("unchecked") static <T> Bucket<T> get(Type type, int numBuckets) { Preconditions.checkArgument(numBuckets > 0, - "The number of bucket(s) must be larger than zero, but is %s", numBuckets); switch (type.typeId()) { case DATE: Same here. What about "Invalid number of bucke...
codereview_java_data_10105
DEPLOYED_TO_UNPAUSE, BOUNCED, SCALED, - SCALE_REVERTED, - PRIORITIZED, - PRIORITY_REVERTED } @JsonCreator are we able to maybe fold these into UPDATED instead somehow? these fields come through on things that a lot of other systems pull in and the roll out can be a pain with the deployer/...
codereview_java_data_10110
boolean authFailure = true; if (error instanceof AllNodesFailedException) { Collection<Throwable> errors = ((AllNodesFailedException) error).getErrors().values(); for (Throwable nodeError : errors) { if (!(nodeError instanceof AuthenticationException)) { authFailure = false; ...
codereview_java_data_10112
private final EnumSet<MetricCategory> enabledCategories = EnumSet.allOf(MetricCategory.class); - public PrometheusMetricsSystem() {} public static MetricsSystem init(final MetricsConfiguration metricsConfiguration) { if (!metricsConfiguration.isEnabled()) { This is deliberately not public. use `init()` ```...
codereview_java_data_10116
.withCreateContextFn(ctx -> channelFn.get().build()) .withCreateServiceFn((ctx, channel) -> new UnaryService<>(channel, callStubFn)) .withDestroyServiceFn(UnaryService::destroy) - .withDestroyContextFn(channel -> channel.shutdown().awaitTermination(5, Ti...
codereview_java_data_10125
.add(newBatchedWriteBehindConfiguration(5, SECONDS, 2).build()) .buildConfig(String.class, String.class)); - testCache.put("key1", "value"); assertThat(writeBehindProvider.getWriteBehind().getQueueSize(), is(1L)); } finally { cacheManager.close(); This test will run for 5 ...
codereview_java_data_10127
String message = t.getMessage(); - if ( - message != null && - message.equals( - "Error while trying to send request. Status: 403 Message: \'Framework is not subscribed\'" - ) - ) { return CompletableFuture.runAsync( () -> scheduler.onUncaughtException(new PrematureChann...
codereview_java_data_10130
* necessary so that such topics can't clash with regular topics used * for other purposes. */ - private static final String JET_OBSERVABLE_NAME_PREFIX = INTERNAL_JET_OBJECTS_PREFIX + "observable."; private ObservableUtil() { } I meant the prefix should be `observables.`, also this should...
codereview_java_data_10137
return tabletFile; } - @Test - public void testEquivalence() { - TabletFile newFile = new TabletFile( - new Path("hdfs://localhost:8020/accumulo/tables/2a/default_tablet/F0000070.rf")); - TabletFile tmpFile = new TabletFile(new Path(newFile.getMetaInsert() + "_tmp")); - TabletFile newFile2 = n...
codereview_java_data_10139
return batchWriterConfig; } - public ConditionalWriterConfig getConditionalWriterConfig() { ensureOpen(); if (conditionalWriterConfig == null) { Properties props = info.getProperties(); Should probably make this method synchronized. Could have one thread getting this object while another is s...
codereview_java_data_10142
} else { jetInstance.shutdown(); } - }); } } would be good to give the thread a name } else { jetInstance.shutdown(); } + }, "jet.ShutdownThread"); } }
codereview_java_data_10148
*/ package org.apache.accumulo.server.conf.store.impl; import java.util.HashMap; import java.util.HashSet; import java.util.Map; Some options to get rid of the read/write locks: ConcurrentHashMap or Collections.synchronizedMap */ package org.apache.accumulo.server.conf.store.impl; +import java.util.Collectio...
codereview_java_data_10150
} @Override - public List<DMLResponseHandler> getMerges() { return this.merges; } why remove final } @Override + public final List<DMLResponseHandler> getMerges() { return this.merges; }
codereview_java_data_10155
MessageExt poll(final KeyValue properties) { int currentPollTimeout = clientConfig.getOperationTimeout(); - if (properties.containsKey("TIMEOUT")) { - currentPollTimeout = properties.getInt("TIMEOUT"); } return poll(currentPollTimeout); } Here,the "TIMEOUT" value ...
codereview_java_data_10164
} } public Production substituteProd(Production prod, Sort expectedSort, BiFunction<Integer, Production, Sort> getSort, HasLocation loc) { Production substituted = prod; List<Sort> args = new ArrayList<>(); This needs a small description. } } + /** + * Generat...
codereview_java_data_10165
*/ default <K> Map<K, T> toMapBy(Function<? super T, ? extends K> keyMapper) { Objects.requireNonNull(keyMapper, "keyMapper is null"); - return toMap(keyMapper, v -> v); } /** identity() instead of v -> v */ default <K> Map<K, T> toMapBy(Function<? super T, ? extends K>...
codereview_java_data_10170
import org.h2.message.DbException; import org.h2.mvstore.DataUtils; import org.h2.mvstore.FileStore; -import org.h2.mvstore.MVMap; import org.h2.mvstore.MVStore; import org.h2.mvstore.MVStoreTool; import org.h2.mvstore.tx.Transaction; A leftover import. import org.h2.message.DbException; import org.h2.mvstore...
codereview_java_data_10181
protected Store<K, V> kvStore; @After public void tearDown() { if (kvStore != null) { The introduction of `@Before` allows this code to be refactored into a `setUp` method. protected Store<K, V> kvStore; + @Before + public void setUp() { + kvStore = factory.newStore(factory.newConfiguration(fact...
codereview_java_data_10185
* @author Shane Bryzak * */ -public @RequestScoped @Named class LoginAction { @Inject Identity identity; Put annotations before the public keyword on their own line * @author Shane Bryzak * */ +@RequestScoped +@Named +public class LoginAction { @Inject Identity identity;
codereview_java_data_10196
// This code will even wait on tablets that are assigned to dead tablets servers. This is // intentional because the master may make metadata writes for these tablets. See #587 log.debug( - "Still waiting for table({}) to be deleted, Tablet state to be UNASSIGNED. Tablet state: {} ...
codereview_java_data_10201
* <b>Sample Spring XML for Hazelcast Jet Client:</b> * <pre>{@code * <jet:client id="client"> - * <jet:group name="jet" password="jet-pass"/> * <jet:network connection-attempt-limit="3" * connection-attempt-period="3000" * connection-timeout="1000" group password is now remove...
codereview_java_data_10204
"cast", "coalesce", "convert", "csvread", "csvwrite", "currval", "database-path", "database", "decode", "disk-space-used", "file-read", "file-write", "greatest", "h2version", "identity", - "ifnull", "least", "link-schema", "lock-mode", "lock-timeout", ...
codereview_java_data_10206
void completeJob(MasterContext masterContext, long completionTime, Throwable error) { // the order of operations is important. - long jobId = masterContext.getJobId(); String coordinator = nodeEngine.getNode().getThisUuid(); jobRepository.completeJob(jobId, coordinator, completion...
codereview_java_data_10216
StoredTabletFile metaFile = null; long startTime = System.currentTimeMillis(); - long entriesWritten = 0; - boolean failed = false; CompactionStats stats = new CompactionStats(); try { What does this method do? If its nots quick to explain just let me know, I can look at the source. Sto...
codereview_java_data_10221
return rel; } if (rowType.getFieldCount() != castRowType.getFieldCount()) { - throw new IllegalArgumentException("Field count is not equal: " + "rowType [" + rowType + "] castRowType [" + castRowType + "]"); } final RexBuilder rexBuilder = rel.getCluster().getRexBuilder(); co...
codereview_java_data_10224
* @param schedulerId threads run taskId. * @param run whether to run. */ - private void updateSchedulerMap(Integer schedulerId, Boolean run) { synchronized (schedulerMap) { Map<Integer, Boolean> copy = new HashMap<Integer, Boolean>(schedulerMap.get()); - cop...
codereview_java_data_10228
.comment(MainApp.gs(R.string.smb_frequency_exceeded)) .enacted(false).success(false)).run(); } } PumpInterface pump = getActivePump(); isn't there a `return` missing to guard from further execution and still adding it to the `CommandQueue...
codereview_java_data_10240
result.onError(t1); return null; } - } finally { - PooledObjects.close(content); } return null; Don't we have try / resources now? result.onError(t1); return null; } } return null;
codereview_java_data_10242
assertEquals("DEFAULT", conf.get(Property.INSTANCE_SECRET)); assertEquals("", conf.get(Property.INSTANCE_VOLUMES)); assertEquals("120s", conf.get(Property.GENERAL_RPC_TIMEOUT)); - @SuppressWarnings("deprecation") - Property deprecatedProp = Property.TSERV_WALOG_MAX_SIZE; - assertEquals("1G", con...
codereview_java_data_10249
try { dockerUtils.pull(task.getTaskInfo().getContainer().getDocker().getImage()); } catch (DockerException e) { - throw new ProcessFailedException(String.format("Could not pull docker image due to error: %s", e)); } } Don't add the exception to an error message, include the ex...
codereview_java_data_10253
this.plannerFactory = Objects.requireNonNull(plannerFactory, "plannerFactory"); this.conformance = Objects.requireNonNull(conformance, "conformance"); this.contextTransform = Objects.requireNonNull(contextTransform, "contextTransform"); - this.typeFactory = typeFactory; } public RelR...
codereview_java_data_10276
MISSING_HOOK_OCAML, MISSING_SYNTAX_MODULE, INVALID_EXIT_CODE, - DEPRECATED_BACKEND, INVALID_CONFIG_VAR, FUTURE_ERROR, UNUSED_VAR, I think backend-specific things should not be in this list. So we should just have `MISSING_HOOK`, instead of `MISSING_HOOK_OCAM...
codereview_java_data_10278
isContributionsFragmentVisible = false; updateMenuItem(); // Do all permission and GPS related tasks on tab selected, not on create - ((NearbyParentFragment)contributionsActivityPagerAdapter.getItem(1)).nearbyParentFragmen...
codereview_java_data_10282
*/ package zipkin2.internal; -import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; Dunno if it's kosher for this codebase but awaitility makes these sort of tests simpler without having to worry about...
codereview_java_data_10284
import java.util.Optional; import java.util.concurrent.ExecutionException; -import static com.github.javaparser.ParseStart.*; -import static com.github.javaparser.ParserConfiguration.LanguageLevel.*; import static com.github.javaparser.Providers.provider; /** Yes, I should have written this a long time ago... im...
codereview_java_data_10286
for (Account account: preferences.getAccounts()) { if (accountUuids.contains(account.getUuid())) { LocalStore localStore = DI.get(LocalStoreProvider.class).getInstance(account); - LocalFolder.createLocalFolder(localStore, Account.OUTBOX, outboxName);...
codereview_java_data_10298
closeData(); - BCFile.Writer.BlockAppender mba = fileWriter.prepareMetaBlock("RFile.index"); mba.writeInt(RINDEX_MAGIC); mba.writeInt(RINDEX_VER_8); Could just use BlockAppender here with an import closeData(); + BlockAppender mba = fileWriter.prepareMetaBlock("RFile.index"); ...
codereview_java_data_10303
public abstract void fireBeforeSelectTriggers(); /** - * Indicate to this query that it is an exists subquery. */ public abstract void setExistsSubquery(boolean isExistsSubquery); Indicate to this query that it is wrapped inside an EXISTS() public abstract void fireBeforeSelectTriggers()...
codereview_java_data_10306
} public static void clearCache(Instance instance) { - cacheResetCount.incrementAndGet(); getZooCache(instance).clear(ZooUtil.getRoot(instance) + Constants.ZTABLES); getZooCache(instance).clear(ZooUtil.getRoot(instance) + Constants.ZNAMESPACES); - tableMapCache = null; } /** There is also a...
codereview_java_data_10309
this.key = key; } /** * Returns the grouping key. */ I think it would be better to implement Map.Entry here, or extend `TimestampedEntry` so that it can be directly written to map sink. WindowResult can be perhaps an interface? this.key = key; } + /** + * @param sta...
codereview_java_data_10316
@Override public String toString() { return MoreObjects.toStringHelper(this) - .add("dataFilesCount", dataFilesCount.get()) - .add("dataFilesRecordCount", dataFilesRecordCount.get()) - .add("dataFilesByteCount", dataFilesByteCount.get()) - .add("deleteFilesCount", deleteFilesCount...
codereview_java_data_10317
} public void onResume() { super.onResume(); I couldn't see the alternate code for this method. } + @Override + @NavigationDrawerType + public int getNavigationDrawerType() { + return ITEM_ALERT; + } + public void onResume() { super.onResume();
codereview_java_data_10322
// END FLOW-CONTROL STATE - public ReceiverTasklet(OutboundCollector collector, int rwinMultiplier, int flowControlPeriodMs, - LoggingService loggingService) { this.collector = collector; this.rwinMultiplier = rwinMultiplier; this.flowControlP...
codereview_java_data_10330
@Test public void testPrintHelloWorld() throws Exception { - String xpath = "//ASTTermApplyNode/ASTTermNameNode[@Image=\"println\"]"; rule.setXPath(xpath); rule.setVersion(XPathRuleQuery.XPATH_2_0); Report report = getReportForTestString(rule, Yes, I'd say we should go witho...
codereview_java_data_10336
try { if (userpoolsLoginKey.equals(mStore.get(PROVIDER_KEY))) { String token = mStore.get("token"); - return (String) CognitoJWTParser.getPayload(token).get("sub"); } return null; } catch (Exception e) { is this equivalent to the ...
codereview_java_data_10340
} } - public void onCryptoModeChanged(CryptoMode type) { - recipientPresenter.onCryptoModeChanged(type); } enum Action { `type` as parameter name seems odd. } } + @Override + public void onCryptoModeChanged(CryptoMode cryptoMode) { + recipientPresenter.onCr...
codereview_java_data_10347
} } public Row getTemplateRow() { return database.createRow(new Value[getColumns().length], Row.MEMORY_CALCULATE); } this is a little icky, it means that the columns field no longer always applies to the Table class. Probably better to create an AbstractTable class to act as the common...
codereview_java_data_10356
values[i] = SortOrder.valueOf(valueStrs[i]); } - int idxCurrentSort = -1; for (int i = 0; i < values.length; i++) { - if (currentSortOrder == values[i] || currentSortOrder == null) { idxCurrentSort = i; break; } Thanks for...
codereview_java_data_10363
* @param consumer * emit counter objects derived from key and value to this consumer */ - void convert(Key k, Consumer<K> consumer); } /** This looks like it shouldn't be removed. * @param consumer * emit counter objects derived from key and value to this consu...
codereview_java_data_10377
args.put("endpoints.shutdown.enabled", "true"); ModuleLaunchRequest moduleLaunchRequest = new ModuleLaunchRequest(module); launcher.launch(Arrays.asList(moduleLaunchRequest)); ModuleDeploymentId id = new ModuleDeploymentId(request.getDefinition().getGroup(), request.getDefinition().getLabel()); these ...
codereview_java_data_10388
public boolean isPrimitive() { return clazz.isPrimitive(); } - - // not an override - public boolean equals(JavaTypeDefinition def) { // TODO: JavaTypeDefinition generic equality return clazz.equals(def.clazz) && getTypeParameterCount() == def.getTypeParameterCount(); } ...
codereview_java_data_10390
private HttpRequestFactory httpRequestFactory; private Optional<EthNetworkConfig> ethNetworkConfig = Optional.empty(); private boolean useWsForJsonRpc = false; - private boolean useAuthenticationTokenInHeaderForJsonRpc = false; private String token = null; public PantheonNode( Can probably simplify thi...
codereview_java_data_10392
assertEquals("mysecret", conf.get(Property.INSTANCE_SECRET)); assertEquals("hdfs://localhost:8020/accumulo123", conf.get(Property.INSTANCE_VOLUMES)); assertEquals("123s", conf.get(Property.GENERAL_RPC_TIMEOUT)); - @SuppressWarnings("deprecation") - Property deprecatedProp = Property.TSERV_WALOG_MAX...
codereview_java_data_10395
public class Kafka8MessageTimestamp implements KafkaMessageTimestamp { @Override - public Long getTimestamp(MessageAndMetadata<byte[], byte[]> kafkaMessage) { return 0l; } @Override - public Long getTimestamp(MessageAndOffset messageAndOffset) { return 0l; } } Looks like b...
codereview_java_data_10398
* @param preInvocationAdvice the {@link PreInvocationAuthorizationAdvice} to use * @param postInvocationAdvice the {@link PostInvocationAuthorizationAdvice} to use */ - public PrePostAdviceReactiveMethodInterceptor(MethodSecurityMetadataSource attributeSource, PreInvocationAuthorizationReactiveAdvice preInvoca...
codereview_java_data_10402
return context.getContentResolver().acquireContentProviderClient(CONTRIBUTION_AUTHORITY); } - @Provides - @Named("revertCount") - public SharedPreferences provideRevertCountSharedPreferences( Context context) { - return context.getSharedPreferences("revertCount", MODE_PRIVATE); - } - ...
codereview_java_data_10403
"\t| | | | / | | | | | | | \\ | | | \n" + "\to o o o o---o o---o o---o o---o o o o---o o o--o o---o o "); logger.info("Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved."); - - Runtime.getRuntime().a...
codereview_java_data_10404
Stage stageOne = (Stage) cmmnModel.getPrimaryCase().getPlanModel().findPlanItemDefinitionInStageOrDownwards("stageOne"); List<PlanItem> planItems1 = stageOne.getPlanItems(); assertThat(planItems1).hasSize(1); - assertThat(planItems1) - .extracting(planItem2 -> planItem2....
codereview_java_data_10416
import java.util.Date; import java.util.HashMap; import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.Random; import java.util.Set; This does not seem to be used anywhere. unused import? import java.util.Date; import java.util.HashMap; import java.util.HashSet; import jav...
codereview_java_data_10431
Claims claims = Jwts.claims().setSubject(userName); return Jwts.builder().setClaims(claims).setExpiration(validity) - .signWith(Keys.hmacShaKeyFor(Decoders.BASE64.decode(authConfigs.getSecretKey())), - SignatureAlgorithm.HS256).compact(); } /** Please d...
codereview_java_data_10432
final HashSet<T> set = (HashSet<T>) elements; return set; } - if (Collections.isEmpty(elements) || this.equals(elements)){ return this; } else { - return new HashSet<>(addAll(tree, elements)); } } The new way is only better when t...
codereview_java_data_10433
LOG.fine("Adding host: " + host.asSummary()); hosts.add(host); - LOG.info(String.format("Added node %s.", node.getId().toUuid())); host.runHealthCheck(); Runnable runnable = host::runHealthCheck; Prefer adding a `toString` to `NodeId`. LOG.fine("Adding host: " + host.asSummary(...
codereview_java_data_10439
} /** - * @return true if struct represents union schema */ - public boolean isUnionSchema() { - return isUnionSchema; } } Why do we need this in the main API? The API should not expose unions or info about union IMO. } /** + * @return true if struct represents union ...
codereview_java_data_10446
@Override public void setDataSource(String streamUrl, String username, String password) { } } Should this call the method without username and password? @Override public void setDataSource(String streamUrl, String username, String password) { + try { + setDataSource(streamU...
codereview_java_data_10448
import org.springframework.boot.autoconfigure.security.oauth2.OAuth2AutoConfiguration; import org.springframework.boot.autoconfigure.web.HttpMessageConverters; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.cloud.dataflow.server.completion.TapOnDestinati...
codereview_java_data_10450
List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableName.getBytes(UTF_8))); Map<String,String> opts = new HashMap<>(); try { - cancelCompaction(tableName); doTableFateOperation(tableName, TableNotFoundException.class, FateOperation.TABLE_DELETE, args, opts); } catch (Ta...
codereview_java_data_10451
// default network option // Then we have no control over genesis default value here. @CommandLine.Option( - names = {"--private-genesis-file"}, paramLabel = MANDATORY_FILE_FORMAT_HELP, description = - "The path to genesis file. Setting this option makes --chain option ignored and requires ...
codereview_java_data_10455
assertTrue(scopes.contains(IteratorScope.majc)); Map<String,String> config = tops.getConfiguration(MetadataTable.NAME); - HashMap<String,String> properties = new HashMap<>(); - config.forEach(properties::put); for (IteratorScope scope : scopes) { String key = Property.TABLE_ITERA...
codereview_java_data_10460
boolean transferOK = HAService.this.push2SlaveMaxOffset.get() >= req.getNextOffset(); long waitUntillWhen = HAService.this.defaultMessageStore.getSystemClock().now() + HAService.this.defaultMessageStore.getMessageStoreConfig().getSyncFlushTi...
codereview_java_data_10464
args.add(ByteBuffer.wrap(String.valueOf(numSplits).getBytes(UTF_8))); if (numSplits > 0) { for (Text t : ntc.getSplits()) { - args.add(ByteBuffer.wrap(t.toString().getBytes(UTF_8))); } } Splits may be binary data. Converting Text to a String and then to a ByteBuffer could scramble t...
codereview_java_data_10474
@Override public Cursor getCursor() { - return DatabaseFactory.getImageDatabase(getContext()).getMediaForThread(threadId); } } } getImageDatabase(...) -> getMediaDatabase(...) in DatabaseFactory @Override public Cursor getCursor() { + return DatabaseFactory.getMediaDatabase(getC...
codereview_java_data_10489
} @Override - public ImmutableList<String> struct(Types.StructType readStruct, Iterable<List<String>> fieldErrorLists) { Preconditions.checkNotNull(readStruct, "Evaluation must start with a schema."); if (!currentType.isStructType()) { We don't typically use `ImmutableList` to avoid leaking it in meth...
codereview_java_data_10496
} public void decrementOpenFiles(int numOpenFiles) { - openFiles.addAndGet(numOpenFiles); } @Override In the cases where this is used, will the value of `openFiles` ever actually be decremented? It looks like `incrementOpenFiles()` and `decrementOpenFiles()` will both do the same thing at the moment. Is...
codereview_java_data_10506
// drop wal walPath = walPath.getParent(); - walPath = new Path(walPath, - FileType.RECOVERY.getDirectory() + '-' + context.getUniqueNameAllocator().getNextName()); - log.debug("Unique Name Allocated: " + walPath); walPath = new Path(walPath, uuid); return walPath; ```su...
codereview_java_data_10509
* @param member {@link Member} */ public static void onSuccess(Member member) { manager.getMemberAddressInfos().add(member.getAddress()); member.setState(NodeState.UP); member.setFailAccessCnt(0); - manager.notifyMemberChange(); } public static void onFail(Me...
codereview_java_data_10518
* best-practice to set uid for all operators</a> before deploying to production. Flink has an option to {@code * pipeline.auto-generate-uids=false} to disable auto-generation and force explicit setting of all operator uids. * <br><br> - * Be careful with setting this for an existing job, because n...
codereview_java_data_10520
assertThatThrownBy(() -> runtimeService.startProcessInstanceByKey("failStatusCodes")) .isExactlyInstanceOf(FlowableException.class) .hasMessage("HTTP400"); - assertThat(process).as("Process instance was not started.").isNull(); } @Test This is always null sin...
codereview_java_data_10525
// snippet-sourcetype:[snippet] // snippet-sourcedate:[2019-01-10] // snippet-sourceauthor:[AWS] - /** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. Do you mean TranscriptResultStream? Also, second sentence needs a period: ...for more details. // snippet-sourcetype:[snippet] // snippet-...
codereview_java_data_10526
private static final int DEFAULT_WORLD_STATE_MAX_REQUESTS_WITHOUT_PROGRESS = 1000; private static final long DEFAULT_WORLD_STATE_MIN_MILLIS_BEFORE_STALLING = TimeUnit.MINUTES.toMillis(5); - private static final int DEFAULT_MAX_GET_BLOCK_HEADERS = 192; - private static final int DEFAULT_MAX_GET_BLOCK_BODI...
codereview_java_data_10537
this.master = master; existenceCache = CacheBuilder.newBuilder().expireAfterWrite(timeToCacheExistsInMillis, TimeUnit.MILLISECONDS) - .maximumWeight(10000000).weigher(new Weigher<Path,Boolean>() { @Override public int weigh(Path path, Boolean exist) { ...
codereview_java_data_10539
@Override public ConnectionType setNetworkConnection( ConnectionType type) { - Map<String, Integer> mode = ImmutableMap.of("type", type.getBitMask()); return new ConnectionType(((Number) executeMethod.execute(DriverCommand.SET_NETWORK_CONNECTION, ...
codereview_java_data_10544
/** * We use map because there can be nested, anonymous etc classes. */ - private Map<String, JavaClassObject> classObjectsByName = new HashMap<>(); private SecureClassLoader classLoader = new SecureClassLoader() { This field needs to have default visibility to avoid synthe...
codereview_java_data_10547
*/ package tech.pegasys.pantheon.consensus.ibft; -import tech.pegasys.pantheon.ethereum.core.Address; import tech.pegasys.pantheon.ethereum.p2p.api.Message; -import tech.pegasys.pantheon.ethereum.p2p.api.MessageData; - -import java.util.List; public interface Gossiper { - boolean gossipMessage(Message message); -...
codereview_java_data_10552
case NOT_EQ: return String.valueOf(ref()) + " != " + literal(); case STARTS_WITH: - return "startsWith(" + ref() + "," + literal() + ")"; // case IN: // break; // case NOT_IN: I wonder if it would be more clear to use `ref() + "LIKE '" + literal() + "%'"` instead of th...
codereview_java_data_10553
@Override default List<T> padTo(int length, T element) { - if(length == 0) { return this; } else { - return appendAll(Stream.gen(() -> element).take(length)); } } here also - it should be take(length - this.length()), am I right? @Override defa...
codereview_java_data_10555
private static <T extends Node> T simplifiedParse(ParseStart<T> context, Provider provider) { ParseResult<T> result = new JavaParser(staticConfiguration).parse(context, provider); if (result.isSuccessful()) { - considerInjectingSymbolResolver(result, staticConfiguration); ...
codereview_java_data_10559
int numTasksToShutDown = Math.max(otherActiveTasks.size() - (request.getInstancesSafe() - deployProgress.getTargetActiveInstances()), 0); List<SingularityTaskId> sortedOtherTasks = new ArrayList<>(otherActiveTasks); Collections.sort(sortedOtherTasks, SingularityTaskId.INSTANCE_NO_COMPARATOR); - return...
codereview_java_data_10567
import java.util.List; /** - * An extension of StreamDefinitionException that remembers the point up * to which parsing went OK (signaled by a '*' in the dumped message). * * @author Eric Bottard `StreamDefinitionException` -> `TaskDefinitionException` import java.util.List; /** + * An extension of TaskDefi...
codereview_java_data_10570
@JsonProperty private String dockerPrefix = "se-"; - @NotNull @JsonProperty private int dockerStopTimeout = 15; `int` can't be null, but could could default to zero -- we should decide what a good minimum is, and then use the `@Min` annotation @JsonProperty private String dockerPrefix = "se-"; + @...
codereview_java_data_10573
String lang = Locale.getDefault().getLanguage(); - HashMap<String, RequestBody> imgMap = new HashMap<>(); imgMap.put("code", image.getCode()); imgMap.put("imagefield", image.getField()); imgMap.put("imgupload_front\"; filename=\"front_"+ lang +".png\"", image.getImguploadFront...
codereview_java_data_10591
(Traversable<?> seq, Object elem) -> ((List<Object>) seq).remove(elem) ); - final BiFunction<Traversable<?>, Object, Traversable<?>> add; - final BiFunction<Traversable<?>, Object, Traversable<?>> remove; ContainerType(BiFunction<Traversable<?>, Object, Traversable<?>> a...
codereview_java_data_10592
this.to = receiptWithMetadata.getTransaction().getTo().map(BytesValue::toString).orElse(null); this.transactionHash = receiptWithMetadata.getTransaction().hash().toString(); this.transactionIndex = Quantity.create(receiptWithMetadata.getTransactionIndex()); - this.revertReason = - receipt - ...
codereview_java_data_10596
@Override public Void visitDynamicParam(RexDynamicParam dynamicParam) { found = true; - return super.visitDynamicParam(dynamicParam); } @Override public Void visitInputRef(RexInputRef inputRef) { found = tr...
codereview_java_data_10597
return null; } Integer row_port = row.getInteger("native_port"); - if (row_port == null) { row_port = port; } return addressTranslator.translate(new InetSocketAddress(nativeAddress, row_port)); Please use the Java conventions for variable names: `rowPort`. return null; ...
codereview_java_data_10598
*/ package org.apache.accumulo.core.manager.balancer; import java.util.HashMap; import java.util.Map; -import java.util.Objects; import org.apache.accumulo.core.master.thrift.TabletServerStatus; import org.apache.accumulo.core.spi.balancer.data.TServerStatus; This is cleanest with a static import of `requireNon...
codereview_java_data_10603
} public static ResultSet testFunctionIndexFunction() { SimpleResultSet rs = new SimpleResultSet(); rs.addColumn("ID", Types.INTEGER, ValueInt.PRECISION, 0); rs.addColumn("VALUE", Types.INTEGER, ValueInt.PRECISION, 0); this test is not verifying that we call testFunctionIndexFuncti...