id stringlengths 29 30 | content stringlengths 152 2.6k |
|---|---|
codereview_new_java_data_4508 | private static void cleanAllOld(ServerContext context, final ZooReaderWriter zk)
private static boolean checkCurrentInstance(ServerContext context, String instanceName,
String instanceId) {
if (instanceId.equals(context.getInstanceID().canonical())) {
- String prompt = String.valueOf(
- ... |
codereview_new_java_data_4509 | Fate<Manager> fate() {
+ " at time " + System.currentTimeMillis();
// include stack trace so we know where it's coming from, in case we need to troubleshoot it
log.warn("{} blocked until fate starts", msgPrefix,
- new IllegalStateException("Attempted fate action before fate was starte... |
codereview_new_java_data_4510 | void modifyProperties(Consumer<Map<String,String>> mapMutator) throws AccumuloEx
Map<String,String> getSystemConfiguration() throws AccumuloException, AccumuloSecurityException;
/**
- * Retrieves the configured System properties from zookeeper. This method is different from
- * {@link #getSystemConfigurati... |
codereview_new_java_data_4511 | void modifyProperties(Consumer<Map<String,String>> mapMutator) throws AccumuloEx
*/
Map<String,String> getSystemConfiguration() throws AccumuloException, AccumuloSecurityException;
- /**
- * Retrieves the stored System properties from zookeeper. This method is different from
- * {@link #getSystemConfigur... |
codereview_new_java_data_4512 | void setProperty(final String property, final String value)
* accepted.
*
* <p>
- * Accumulo has multiple layers of properties that for many APIs and SPIs presented as single
- * merged view. This API does not offer that merged view, it only offers the properties set at the
- * system layer to the ma... |
codereview_new_java_data_4513 | public int execute(final String fullCommand, final CommandLine cl, final Shell s
final Map<String,String> configuration = shellState.getAccumuloClient().tableOperations()
.getConfiguration(cl.getOptionValue(createTableOptCopyConfig.getOpt()));
- Map<String,
- String> propsToAd... |
codereview_new_java_data_4514 | private static String getFmtTime(final long epoch) {
/**
* Get the ZooKeeper digest based on the instance secret that is used within ZooKeeper for
- * authentication. This method is primary intended to be used to valid ZooKeeper ACLs. Use
* {@link #digestAuth(ZooKeeper, String)} to add authorizations to... |
codereview_new_java_data_4515 | private static String getFmtTime(final long epoch) {
/**
* Get the ZooKeeper digest based on the instance secret that is used within ZooKeeper for
- * authentication. This method is primary intended to be used to valid ZooKeeper ACLs. Use
* {@link #digestAuth(ZooKeeper, String)} to add authorizations to... |
codereview_new_java_data_4516 | public static void execute(final ServerContext context, final boolean clean,
}
if (clean) {
- // If clean is set to true thenn a specific instance should not be set
if (instance != null) {
throw new IllegalArgumentException(
"Cannot set clean flag to true and also an insta... |
codereview_new_java_data_4517 | public boolean failTx(AdminUtil<FateCommand> admin, ZooStore<FateCommand> zs, Zo
@Override
public String description() {
- return "WARNING: This command is deprecated for removal";
}
@Override
```suggestion
return "manage FATE transactions (WARNING: This command is deprecated for removal)";
`... |
codereview_new_java_data_4518 | static class FateOpsCommand {
@Parameter(names = "--summary", description = "Print a summary of FaTE transaction information")
boolean summarize = false;
- @Parameter(names = {"-j", "--json"}, description = "Print Operations in json")
boolean printJson = false;
@Parameter(names = {"-s", "--s... |
codereview_new_java_data_4519 | public void testGetTimeType() throws Exception {
exec("createtable tmtype", true);
exec("gettimetype", true, TimeType.MILLIS.toString());
exec("gettimetype -t tmtype", true, TimeType.MILLIS.toString());
exec("gettimetype -t accumulo.metadata", true, TimeType.LOGICAL.toString());
exec("gettimet... |
codereview_new_java_data_4520 | public TimeType getTimeType(final String tableName) throws TableNotFoundExceptio
Optional<TabletMetadata> tabletMetadata = context.getAmple().readTablets().forTable(tableId)
.fetch(TabletMetadata.ColumnType.TIME).checkConsistency().build().stream().findFirst();
TabletMetadata timeData =
- tab... |
codereview_new_java_data_4521 | protected void merge(AccumuloClient client, String table, List<Size> sizes, int
Text start = sizes.get(0).extent.prevEndRow();
Text end = sizes.get(numToMerge - 1).extent.endRow();
message("Merging %d tablets from (%s to %s]", numToMerge,
- start == null ? "-inf" : Key.toPrintableString(s... |
codereview_new_java_data_4522 | private String createTableAndReturnTableName(AccumuloClient client) throws Accum
} catch (TableExistsException e) {
log.debug("Table {} already exists. Deleting and trying again.", tableName);
client.tableOperations().delete(tableName);
- createTableAndReturnTableName(client);
}
// wh... |
codereview_new_java_data_4523 | private String createTableAndReturnTableName(AccumuloClient client) throws Accum
} catch (TableExistsException e) {
log.debug("Table {} already exists. Deleting and trying again.", tableName);
client.tableOperations().delete(tableName);
- createTableAndReturnTableName(client);
}
// wh... |
codereview_new_java_data_4524 |
* and other actions in the cluster can impact the estimated size such as flushes, tablet splits,
* compactions, etc.
*
- * For the most accurate information a compaction should first be run on the set of tables being
- * computed.
*/
public class TableDiskUsage {
```suggestion
* For more accurate informa... |
codereview_new_java_data_4525 | class PopulateMetadataTable extends ManagerRepo {
static void readMappingFile(VolumeManager fs, ImportedTableInfo tableInfo, String importDir,
Map<String,String> fileNameMappings) throws Exception {
- try (BufferedReader in = new BufferedReader(
- new InputStreamReader(fs.open(new Path(importDir,... |
codereview_new_java_data_4526 | public void testExportImportOffline() throws Exception {
fs.deleteOnExit(importDirA);
fs.deleteOnExit(importDirB);
for (Path p : new Path[] {exportDir, importDirA, importDirB}) {
- assertTrue(fs.mkdirs(p), "Failed to create " + baseDir);
}
Set<String> importDirs = Set.of(imp... |
codereview_new_java_data_4527 | default void importTable(String tableName, String importDir)
* A set of directories containing the files copied by distcp from exportTable
* @since 2.1.0
*/
- void importTable(String tableName, ImportConfiguration ic, Set<String> importDirs)
throws TableExistsException, AccumuloException, ... |
codereview_new_java_data_4528 | private static boolean createDirs(VolumeManager fs, InstanceId instanceId, Set<S
} else {
success = fs.createNewFile(iidPath);
// the exists() call provides positive check that the instanceId file is present
- if (!success || fs.exists(iidPath)) {
log.info("Created ... |
codereview_new_java_data_4529 | private void verifyUp() throws InterruptedException, IOException {
String secret = getSiteConfiguration().get(Property.INSTANCE_SECRET);
while (!(zk.getState() == States.CONNECTED)) {
- log.info("Waiting for ZK client to connect, state: {}", zk.getState());
Thread.sleep(1000);
}
... |
codereview_new_java_data_4530 | enum TStatus {
*
* @param tid
* transaction id, previously reserved.
- * @param prop
- * name of property to retrieve.
*/
- Serializable getNodeData(long tid, Fate.NodeData prop);
/**
* list all transaction ids in store.
`nodeData` instead of `prop` ?
enum TStatus {
... |
codereview_new_java_data_4531 |
void setStatus(long tid, TStatus status);
/**
- * Set a transaction-specific property.
*
* @param tid
* transaction id
```suggestion
* Set transaction-specific information.
```
void setStatus(long tid, TStatus status);
/**
+ * Set transaction-specific information.
*... |
codereview_new_java_data_4532 | public static long fromString(String fmtTid) {
*/
public static String formatTid(long tid) {
// do not change how this formats without considering implications for persistence
- // original format: String.format("%s%016x%s", PREFIX, tid, SUFFIX);
- // Since 2.1, this format was replaced with the fast... |
codereview_new_java_data_4533 | public void run() {
// check the time so that the read ahead thread is not monopolized
while (iter.hasNext() && bytesAdded < maxResultsSize
&& (System.currentTimeMillis() - startTime) < maxScanTime) {
- final KeyExtent extent;
- final List<Range> ranges;
- {
- fin... |
codereview_new_java_data_4534 | public void readFields(DataInput in) throws IOException {
final byte[] row, cf, cq, cv;
final long ts;
- row = getData(in, ROW_SAME, ROW_COMMON_PREFIX, () -> prevKey.getRowData());
- cf = getData(in, CF_SAME, CF_COMMON_PREFIX, () -> prevKey.getColumnFamilyData());
- cq = getData(in, CQ_SAME, CQ_CO... |
codereview_new_java_data_4535 | Map<String,String> getConfiguration(String tableName)
* Gets per-table properties of a table. This operation is asynchronous and eventually consistent.
* It is not guaranteed that all tablets in a table will return the same values. Within a few
* seconds without another change, all tablets in a table shoul... |
codereview_new_java_data_4536 | public interface PropStore {
void putAll(PropStoreKey<?> propStoreKey, Map<String,String> props);
/**
- * Replaces all current properties with map provided If a property is not included in the new map,
- * the property will not be set.
*
* @param propStoreKey
* the prop cache key
```s... |
codereview_new_java_data_4537 | public interface GarbageCollectionEnvironment {
/**
* Return a list of TableIDs for which we are considering deletes. For the root table this would
- * be the metadata table. For the metadata table, this would be all of the other tables in the
- * system.
*
* @return The table ids
*/
```sugge... |
codereview_new_java_data_4538 | private long removeBlipCandidates(GarbageCollectionEnvironment gce,
@VisibleForTesting
/**
- *
*/
protected void ensureAllTablesChecked(Set<TableId> tableIdsBefore, Set<TableId> tableIdsSeen,
Set<TableId> tableIdsAfter) {
// if a table was added or deleted during this run, it is acceptab... |
codereview_new_java_data_4539 | public long getCandidatesStat() {
return candidates;
}
- @Override
- public boolean isRootTable() {
- return level == DataLevel.ROOT;
- }
-
- @Override
- public boolean isMetadataTable() {
- return level == DataLevel.METADATA;
- }
-
@Override
public Set<TableId> getCandidateTableIDs() {
- ... |
codereview_new_java_data_4540 | public long getCandidatesStat() {
return candidates;
}
- @Override
- public boolean isRootTable() {
- return level == DataLevel.ROOT;
- }
-
- @Override
- public boolean isMetadataTable() {
- return level == DataLevel.METADATA;
- }
-
@Override
public Set<TableId> getCandidateTableIDs() {
- ... |
codereview_new_java_data_4541 | public interface GarbageCollectionEnvironment {
Stream<Reference> getReferences();
/**
- * Return a list of TableIDs for which we are considering deletes. For the root table this would
- * be the metadata table. For the metadata table, this would be the other tables in the system.
*
* @return The t... |
codereview_new_java_data_4542 | public Set<TableId> getCandidateTableIDs() throws InterruptedException {
return Collections.singleton(MetadataTable.ID);
} else if (level == DataLevel.USER) {
Set<TableId> tableIds = new HashSet<>();
- tableIds.remove(MetadataTable.ID);
- tableIds.remove(RootTable.ID);
getTableIDs()... |
codereview_new_java_data_4543 | protected void ensureAllTablesChecked(Set<TableId> tableIdsBefore, Set<TableId>
tableIdsMustHaveSeen.removeAll(tableIdsSeen);
// If anything is left then we missed a table and may not have removed rfiles references
- // from the candidates list that are acutally still in use, which would
// result ... |
codereview_new_java_data_4544 | protected void ensureAllTablesChecked(Set<TableId> tableIdsBefore, Set<TableId>
tableIdsMustHaveSeen.removeAll(tableIdsSeen);
// If anything is left then we missed a table and may not have removed rfiles references
- // from the candidates list that are acutally still in use, which would
// result ... |
codereview_new_java_data_4545 | public boolean validateDataVersion(PropStoreKey<?> storeKey, long expectedVersio
throw new IllegalStateException(ex);
} catch (KeeperException.NoNodeException ex) {
propStoreWatcher.signalZkChangeEvent(storeKey);
} catch (KeeperException ex) {
log.debug("exception occurred verifying data... |
codereview_new_java_data_4546 | private void removeCandidatesInUse(GarbageCollectionEnvironment gce,
log.debug("Candidate was still in use: {}", relativePath);
}
}
-
- // close underlying scanner
- refStream.close();
}
private long removeBlipCandidates(GarbageCollectionEnvironment gce,
Does this actually close t... |
codereview_new_java_data_4547 |
import java.util.Collections;
import java.util.stream.Collectors;
-import org.apache.accumulo.core.Constants;
-import org.apache.accumulo.core.data.TableId;
-import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.ServerColumnFamily;
import org.apache.accumulo.server.fs.VolumeManager;
impor... |
codereview_new_java_data_4590 | static boolean extractHoMM2AssetsFromZip( final File externalFilesDir, final Inp
// It is allowed to extract only files located in these subdirectories
final Set<String> allowedSubdirNames = new HashSet<>();
allowedSubdirNames.add( "anim" );
allowedSubdirNames.add( "data" );
... |
codereview_new_java_data_4707 | public LiteralType getLiteralType() {
return LiteralType.DOUBLE;
} else if (node instanceof LiteralExpression.LongVal) {
return LiteralType.LONG;
- /* TODO: the parser must distinguish decimal vs. double
} else if (node instanceof LiteralExpression.DecimalVal) {
... |
codereview_new_java_data_4708 | public class ClassWithTypeAnnotationsInside {
@A OuterG<@A @B ? extends @B String, @A List<@A @B Object>> complicatedField;
- @Target({ ElementType.TYPE_USE, ElementType.TYPE, ElementType.TYPE_PARAMETER })
public @interface A {
int value() default 1;
}
- @Target({ ElementType.TYPE... |
codereview_new_java_data_4709 | public class ClassWithTypeAnnotationsInside {
@A OuterG<@A @B ? extends @B String, @A List<@A @B Object>> complicatedField;
- @Target({ ElementType.TYPE_USE, ElementType.TYPE, ElementType.TYPE_PARAMETER })
public @interface A {
int value() default 1;
}
- @Target({ ElementType.TYPE... |
codereview_new_java_data_4710 | default boolean annotationAppliesTo(ElementType elementType) {
}
SymAnnot target = getDeclaredAnnotation(Target.class);
if (target == null) {
- return false;
}
return target.attributeContains("value", elementType).isTrue();
}
This is not the right behavior…... |
codereview_new_java_data_4711 | default boolean hasReceiver() {
return false;
}
if (this instanceof JConstructorSymbol) {
- return getEnclosingClass().getEnclosingClass() != null
- && !getEnclosingClass().isStatic();
}
return true;
}
swap these
default boolean hasRec... |
codereview_new_java_data_4712 | public Stream<JMethodSig> streamDeclaredMethods(Predicate<? super JMethodSymbol>
}
- public int getModifiers() {
- return symbol.getModifiers();
- }
-
- @Override
- public @NonNull JClassSymbol getSymbol() {
return symbol;
}
@Override
public final boolean isTop() {... |
codereview_new_java_data_4713 | protected AbstractAstExecSymbol(T node, AstSymFactory factory, JClassSymbol owne
);
NodeStream<ASTAnnotation> annotStream = node.getDeclaredAnnotations();
- if (annotStream.isEmpty()) {
- declaredAnnotations = Collections.emptyList();
- } else {
- final L... |
codereview_new_java_data_4714 |
super(node, factory);
NodeStream<ASTAnnotation> annotStream = node.getDeclaredAnnotations();
- if (annotStream.isEmpty()) {
- declaredAnnotations = Collections.emptyList();
- } else {
- final List<SymAnnot> annotations = new ArrayList<>();
- an... |
codereview_new_java_data_4715 |
}
final NodeStream<ASTAnnotation> annotStream = node.getDeclaredAnnotations();
- if (annotStream.nonEmpty()) {
- myAnnotations = new ArrayList<>();
- annotStream.forEach(anode -> myAnnotations.add(new AstSymbolicAnnot(anode)));
- } else {
- myA... |
codereview_new_java_data_4716 |
import java.util.List;
-import org.junit.Test;
public class ForceLanguageCliTest extends BaseCliTest {
```suggestion
import org.junit.jupiter.api.Test;
```
This test should be a junit5 test, because `BaseCliTest` already uses junit5 annotations
import java.util.List;
+import org.junit.jupiter.ap... |
codereview_new_java_data_4717 | protected List<String> cliStandardArgs() {
return listOf(
"check",
"--no-cache",
- "--no-progress",
"-f", "text",
- "-R", PmdCliTest.RSET_WITH_VIOLATION
);
}
Might not be needed anymore (with the chanages from #4233)
protected Lis... |
codereview_new_java_data_4718 |
/**
* This file is using ISO-8859-1 (Latin-1) encoding.
*
- * ?
*/
public class FileWith_ISO8859-1_Encoding {
I think, this went wrong - the IDE already replaced the important character with a ordinary `?` (U+003F), which means, this file is now also correctly UTF-8 encoded and doesn't contain the problem a... |
codereview_new_java_data_4719 | private void checkImports(TypeNode node, Object data) {
String importStr = firstMatch.getImportedName() + (firstMatch.isImportOnDemand() ? ".*" : "");
String type = firstMatch.isStatic() ? "static " : "";
- addViolation(data, node, new Object[]{node.getImage(), import... |
codereview_new_java_data_4720 | public class ApexUnitTestClassShouldHaveAssertsRule extends AbstractApexUnitTest
ASSERT_METHODS.add("assert.isfalse");
ASSERT_METHODS.add("assert.isinstanceoftype");
ASSERT_METHODS.add("assert.isnotinstanceoftype");
- ASSERT_METHODS.add("assert.isnnull");
ASSERT_METHODS.add("... |
codereview_new_java_data_4721 | public final class ApexMultifileAnalysis {
// test only
static final Logger LOG = LoggerFactory.getLogger(ApexMultifileAnalysis.class);
- /**
- * Instances of the apexlink index and data structures ({@link Org})
- * are stored statically for now. TODO make that language-wide (#2518).
- */
-
... |
codereview_new_java_data_4722 |
public AstInfo(ParserTask task, T rootNode) {
- this(task, rootNode, Collections.emptyMap());
- }
-
- public AstInfo(ParserTask task, T rootNode, Map<Integer, String> suppressionComments) {
- this(task.getTextDocument(), rootNode, task.getLpRegistry(), suppressionComments);
}
p... |
codereview_new_java_data_4723 |
package net.sourceforge.pmd.cli.internal;
public enum ExecutionResult {
OK(0),
ERROR(1),
VIOLATIONS_FOUND(4);
- private final int exitStatusCode;
- ExecutionResult(int exitStatusCode) {
- this.exitStatusCode = exitStatusCode;
}
-
- public int getExitStatusCode() ... |
codereview_new_java_data_4724 | public class PmdLanguageTypeSupport implements ITypeConverter<Language>, Iterabl
@Override
public Language convert(final String value) throws Exception {
return LanguageRegistry.getLanguages().stream()
- .filter(l -> normalizeName(l).equals(value)).findFirst()
.orElse... |
codereview_new_java_data_4725 | public void setReportFile(final Path reportFile) {
this.reportFile = reportFile;
}
- @Option(names = "--use-version", defaultValue = "java-19",
description = "The language version PMD should use when parsing source code.%nValid values: ${COMPLETION-CANDIDATES}",
completionC... |
codereview_new_java_data_4726 | public TestDescriptor[] extractTestsFromXml(Rule rule) {
/**
* Extract a set of tests from an XML file. The file should be
* ./xml/RuleName.xml relative to the test class. The format is defined in
- * test-data.xsd.
*/
RuleTestCollection parseTestCollection(Rule rule) {
String ... |
codereview_new_java_data_4727 |
* A pattern (for pattern matching constructs like {@link ASTInstanceOfExpression InstanceOfExpression}
* or within a {@link ASTSwitchLabel}). This is a JDK 16 feature.
*
- * <p>This interface will be implemented by all forms of patterns.
*
* <pre class="grammar">
*
```suggestion
* <p>This interface is i... |
codereview_new_java_data_4728 |
import net.sourceforge.pmd.annotation.Experimental;
/**
- * A record pattern (JDK19). This can be found on
- * the right-hand side of an {@link ASTInstanceOfExpression InstanceOfExpression}.
*
* <pre class="grammar">
*
- * RecordPattern ::= {@linkplain ASTReferenceType ReferenceType} {@linkplain ASTRecordStr... |
codereview_new_java_data_4729 |
import net.sourceforge.pmd.annotation.Experimental;
/**
- * A record pattern (JDK19). This can be found on
- * the right-hand side of an {@link ASTInstanceOfExpression InstanceOfExpression}.
*
* <pre class="grammar">
*
- * RecordPattern ::= {@linkplain ASTReferenceType ReferenceType} {@linkplain ASTRecordStr... |
codereview_new_java_data_4730 | public void testRelativeReportFileLongOption() throws IOException {
@Test
public void debugLogging() {
- Path reportFile = tempRoot().resolve("out/reportFile.txt");
- runPmdSuccessfully("--debug", "--no-cache", "--dir", srcDir, "--rulesets", DUMMY_RULESET, "-r", reportFile);
assertTh... |
codereview_new_java_data_4731 |
import net.sourceforge.pmd.cpd.Match;
public interface CPDRenderer {
void render(Iterator<Match> matches, Writer writer) throws IOException;
}
Add this additional method to the interface will break any custom renderers that implement CPDRenderer...
Should we maybe introduce a new interface, like "CPDRend... |
codereview_new_java_data_4732 |
import net.sourceforge.pmd.cpd.Match;
public interface CPDRenderer {
void render(Iterator<Match> matches, Writer writer) throws IOException;
}
```suggestion
void render(Map<String, Integer> numberOfTokensPerFile, Iterator<Match> matches, Writer writer) throws IOException;
```
import net.sourcef... |
codereview_new_java_data_4733 |
-/*
- * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
- */
-
-/**
- * The class {@link net.sourceforge.pmd.lang.gherkin.antlr4.GherkinLexer} will be moved to
- * package {@code net.sourceforge.pmd.lang.gherkin.ast} with PMD 7.
- *
- * <p>All other classes will be removed.
- */
-package ... |
codereview_new_java_data_4734 |
import java.util.Properties;
import org.junit.Test;
-import org.junit.rules.ExpectedException;
import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest;
public class GherkinTokenizerTest extends CpdTextComparisonTest {
-
- @org.junit.Rule
- public ExpectedException ex = ExpectedException.none();
-
... |
codereview_new_java_data_4888 | public class DataFlowClientAutoConfiguration {
@Autowired
private @Nullable OAuth2ClientProperties oauth2ClientProperties;
- public DataFlowClientAutoConfiguration() {
- }
-
- public DataFlowClientAutoConfiguration(RestTemplate restTemplate) {
this.restTemplate = restTemplate;
}
I am not a fan of mixing ... |
codereview_new_java_data_4889 | public void testComposedTaskAppArguments() {
@Test
public void testAssignmentOfOauth2ClientCredentialsClientAuthenticationMethod(){
this.contextRunner
- .withInitializer(context -> {
- Map<String, Object> map = new HashMap<>();
- map.put("oauth2ClientCredentialsClientAuthenticationMethod", "POST");
-... |
codereview_new_java_data_5150 |
package net.fabricmc.filament.task.base;
-import javax.inject.Inject;
-
import org.gradle.api.file.RegularFileProperty;
import org.gradle.api.tasks.OutputFile;
public abstract class FileOutputTask extends FilamentTask {
@OutputFile
public abstract RegularFileProperty getOutputFile();
-
- @Inject
- public F... |
codereview_new_java_data_5151 | public TTransport request(FContext context, byte[] payload) throws TTransportExc
byte[] response = makeRequest(context, payload);
TTransport responseTransport = null;
- if(response != null) {
TConfiguration responseConfig =
TConfigurationBuilder.custom().setMaxM... |
codereview_new_java_data_5152 |
import com.workiva.frugal.transport.monitor.FTransportMonitor;
import com.workiva.frugal.transport.monitor.MonitorRunner;
-import org.apache.thrift.TConfiguration;
import org.apache.thrift.transport.TTransport;
import org.apache.thrift.transport.TTransportException;
import org.slf4j.Logger;
Is this import stil... |
codereview_new_java_data_6134 |
@AttributeDefinition(name = "Modbus-ID", description = "ID of Modbus bridge.")
String modbus_id() default "modbus0";
- @AttributeDefinition(name = "Modbus Unit-ID", description = "The Unit-ID of the Modbus device.")
- int modbusUnitId() default 3;
@AttributeDefinition(name = "Modbus target filter", descripti... |
codereview_new_java_data_6135 | public class KacoBlueplanet extends AbstractSunSpecPvInverter implements SunSpec
// .put(DefaultSunSpecModel.S_160, Priority.LOW) // from 40792
// .put(SunSpecModel.S_64204, Priority.LOW) // from 40842
- // We had a Kaco nx3 for testing, which had a modbus ID of 3. A static modbus ID of 1 worked for TCP (no idea... |
codereview_new_java_data_6531 | boolean shouldRetryOperation(ResourceException ex, int retryCount) {
switch (ex.getCode()) {
case ResourceException.CONFLICT:
- if (!ex.getMessage().contains("already has a pending request in a different state")) {
- retry = true;
- }
... |
codereview_new_java_data_6534 |
package com.yahoo.athenz.zms.purge;
import org.apache.commons.lang3.EnumUtils;
we need to add copyright notice
+/*
+ *
+ * * Copyright The Athenz Authors
+ * *
+ * * Licensed under the Apache License, Version 2.0 (the "License");
+ * * you may not use this file except in compliance with the License.
+ * * ... |
codereview_new_java_data_6535 |
package com.yahoo.athenz.zms;
import com.yahoo.rdl.Timestamp;
we need to add copyright notice
+/*
+ * Copyright The Athenz Authors
+ *
+ * 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 Lic... |
codereview_new_java_data_6564 | public static Compressor<ByteBuf> newInstance(String name, DriverContext context
}
}
- @TargetClass(value = Lz4Compressor.class, onlyWith = Lz4Missing.class)
- public static final class DeleteLz4Compressor {}
-
- @TargetClass(value = SnappyCompressor.class)
- public static final class DeleteSnappyCompres... |
codereview_new_java_data_6565 |
*/
@SdkPublicApi
public interface AwsCredentials extends AwsCredentialsIdentity {
-
- @Override
- String accessKeyId();
-
- @Override
- String secretAccessKey();
}
These methods are already defined in `AwsCredentialsIdentity` so thought of removing them from here, but that caused failures from `japic... |
codereview_new_java_data_6566 |
import software.amazon.awssdk.utils.builder.SdkBuilder;
/**
- * A request to resolve an Identity.
*
* The Identity may be determined for each request based on properties of the request (e.g. different credentials per bucket
* for S3).
Nit: Maybe we can add a `link` here or add Identity to `see` below
imp... |
codereview_new_java_data_6567 | public void preprocess(ServiceModel serviceModel) {
return;
}
Map<String, Shape> shapes = serviceModel.getShapes();
- for (String shapeName: customSdkShapes.getShapes().keySet()) {
- customSdkShapes.getShape(shapeName).setSynthetic(true);
- shapes.put(shapeNa... |
codereview_new_java_data_6568 | public static HttpProxyOptions buildProxyOptions(ProxyConfiguration proxyConfigu
return clientProxyOptions;
}
- public static HttpMonitoringOptions revolveHttpMonitoringOptions(ConnectionHealthConfiguration config) {
if (config == null) {
return null;
}
Nit: there's a... |
codereview_new_java_data_6569 | public static Ec2MetadataEndpointProvider instance() {
* Resolve the endpoint to be used for the {@link DefaultEc2MetadataClient} client. Users may manually provide an endpoint
* through the {@code AWS_EC2_METADATA_SERVICE_ENDPOINT} environment variable or the {@code ec2_metadata_service_endpoint}
* ... |
codereview_new_java_data_6570 |
import software.amazon.awssdk.utils.Validate;
/**
- * The class is used for response handling and parsing the metadata fetched by the get call in the {@link Ec2MetadataClient}
- * interface.
- * The class provides convenience methods to the users to parse the metadata as a String, List and Document (json).
*/
@... |
codereview_new_java_data_6571 | public interface Builder extends CopyableBuilder<Ec2MetadataRetryPolicy.Builder,
}
- public static final class BuilderImpl implements Builder {
private Integer numRetries;
private BackoffStrategy backoffStrategy;
- public BuilderImpl() {
}
@Override
Hmm, wh... |
codereview_new_java_data_6572 | public final class DefaultEc2MetadataClient extends BaseEc2MetadataClient implem
private DefaultEc2MetadataClient(Ec2MetadataBuilder builder) {
super(builder);
- // http client
Validate.isTrue(builder.httpClient == null || builder.httpClientBuilder == null,
"The... |
codereview_new_java_data_6573 | public interface Builder extends CopyableBuilder<Builder, S3Configuration> {
/**
* The supplier of profile file instances that should be consulted to determine the default value of
* {@link #useArnRegionEnabled(Boolean)} or {@link #multiRegionEnabled(Boolean)}.
- * This is not used... |
codereview_new_java_data_6574 | private void uploadOnce(List<Double> latencies) throws Exception {
transferManager.uploadDirectory(b -> b.bucket(bucket)
.s3Prefix(config.prefix())
.source(uploadPath));
- CompletedDirectoryUpload ... |
codereview_new_java_data_6575 | public interface FileUpload extends ObjectTransfer {
* See {@link ResumableFileUpload} for supported formats.
*
* <p>
- * Currently, it's only supported if the underlying {@link S3AsyncClient} is CRT-based created via
- * {@link S3AsyncClient#crtBuilder()} or {@link S3AsyncClient#crtCreate()... |
codereview_new_java_data_6576 | public ResumableFileUpload pause() {
private ResumableFileUpload doPause() {
if (clientType != S3ClientType.CRT_BASED) {
- throw new UnsupportedOperationException("Pausing upload is not supported in non CRT-based S3 Client. Consider "
- + "p... |
codereview_new_java_data_6577 | public ResumableFileUpload pause() {
private ResumableFileUpload doPause() {
if (clientType != S3ClientType.CRT_BASED) {
throw new UnsupportedOperationException("Pausing an upload is not supported in a non CRT-based S3 Client. For "
- + "upl... |
codereview_new_java_data_6578 | private static String getMessageForTooManyAcquireOperationsError() {
}
public static String closedChannelMessage(Channel channel) {
- ChannelDiagnostics channelDiagnostics, parentChannelDiagnostics;
if (channel != null) {
channelDiagnostics = channel.attr(CHANNEL_DIAGNOSTICS).get... |
codereview_new_java_data_6579 |
import software.amazon.awssdk.annotations.SdkProtectedApi;
@SdkProtectedApi
public final class RequiredTrait implements Trait {
Could you add a small Javadoc comment to indicate this Trait purpose?
import software.amazon.awssdk.annotations.SdkProtectedApi;
+/**
+ * Trait that indicates a value must be... |
codereview_new_java_data_6580 | public final class QueryParamMarshaller {
};
public static final JsonMarshaller<Void> NULL = (val, context, paramName, sdkField) -> {
- if (context.protocolHandler().isTraitValidationEnabled(RequiredTrait.class)
- && sdkField.containsTrait(RequiredTrait.class)) {
throw new Il... |
codereview_new_java_data_6581 | public boolean hasEvent() {
* @param <T> Type of metadata being requested.
* @return The value of the additional metadata being requested or null if it's not present.
*/
- public <T> T additionalMetadata(OperationMetadataAttribute<T> key) {
return additionalMetadata.get(key);
}
Un... |
codereview_new_java_data_6582 | public String toString() {
* Method to return the number of retries allowed.
* @return The number of retries allowed.
*/
- public int getNumRetries() {
return numRetries;
}
/**
* Method to return the BackoffStrategy used.
* @return The backoff Strategy used.
... |
codereview_new_java_data_6583 | public final class ChannelAttributeKey {
"aws.http.nio.netty.async.channelDiagnostics");
/**
- * {@link AttributeKey} to keep track of whether we have received the {@link LastHttpContent}.
*/
- public static final AttributeKey<Boolean> LAST_HTTP_CONTENT_RECEIVED_KEY = NettyUtils.getOrCreat... |
codereview_new_java_data_6584 | public void notifyError(Exception exception) {
}
public void deliverData(ByteBuffer byteBuffer) {
- log.trace(() -> "received data of size: " + byteBuffer.remaining());
// If the subscription is cancelled, no op
if (isDone) {
return;
Will it be helpful to log this sce... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.