-
Notifications
You must be signed in to change notification settings - Fork 895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update some deprecated references #8314
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,7 @@ | |
import java.util.List; | ||
import java.util.NavigableMap; | ||
import java.util.Optional; | ||
import java.util.concurrent.TimeUnit; | ||
import java.util.concurrent.atomic.AtomicBoolean; | ||
import java.util.concurrent.atomic.AtomicInteger; | ||
import java.util.function.Function; | ||
|
@@ -63,7 +64,7 @@ | |
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
/** See https://github.com/ethereum/devp2p/blob/master/caps/snap.md */ | ||
/** See <a href="https://github.com/ethereum/devp2p/blob/master/caps/snap.md">snap</a> */ | ||
class SnapServer implements BesuEvents.InitialSyncCompletionListener { | ||
private static final Logger LOGGER = LoggerFactory.getLogger(SnapServer.class); | ||
private static final int PRIME_STATE_ROOT_CACHE_LIMIT = 128; | ||
|
@@ -524,7 +525,7 @@ MessageData constructGetTrieNodesResponse(final MessageData message) { | |
var trieNode = optStorage.orElse(Bytes.EMPTY); | ||
if (!trieNodes.isEmpty() | ||
&& (sumListBytes(trieNodes) + trieNode.size() > maxResponseBytes | ||
|| stopWatch.getTime() | ||
|| stopWatch.getTime(TimeUnit.MILLISECONDS) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. time units passed to method. I think milliseconds is right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah milliseconds is the right unit |
||
> ResponseSizePredicate.MAX_MILLIS_PER_REQUEST)) { | ||
break; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,7 +100,7 @@ public Optional<byte[]> get(final SegmentIdentifier segmentId, final byte[] key) | |
throwIfClosed(); | ||
|
||
try (final OperationTimer.TimingContext ignored = metrics.getReadLatency().startTimer()) { | ||
return Optional.ofNullable(snapTx.get(columnFamilyMapper.apply(segmentId), readOptions, key)); | ||
return Optional.ofNullable(snapTx.get(readOptions, columnFamilyMapper.apply(segmentId), key)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. parameter 1 and 2 swapped |
||
} catch (final RocksDBException e) { | ||
throw new StorageException(e); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the change from put to putIfAbsent? I guess either should be fine since the object node is being created in the test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put with those args (String, JsonNode) is deprecated. putIfAbsent was an easy fix and yeah - it's a test, and the test still passes, and I didn't think any further about it