Skip to content

Commit 1fbf735

Browse files
committed
fix coments / renaming
1 parent 13740e1 commit 1fbf735

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

h2/src/main/org/h2/mvstore/FileStore.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,9 @@ protected FileStore(Map<String, Object> config) {
242242
// Make sure pages will fit into cache
243243
if (cache != null) {
244244
maxPageSize = 16 * 1024;
245-
int maxCachableSize = (int) (cache.getMaxItemSize() >> 4);
246-
if (maxPageSize > maxCachableSize) {
247-
maxPageSize = maxCachableSize;
245+
int maxCacheableSize = (int) (cache.getMaxItemSize() >> 4);
246+
if (maxPageSize > maxCacheableSize) {
247+
maxPageSize = maxCacheableSize;
248248
}
249249
}
250250
this.maxPageSize = maxPageSize;
@@ -820,7 +820,6 @@ protected void writeCleanShutdown() {
820820
*
821821
* @param chunk to save
822822
*/
823-
@SuppressWarnings("ThreadPriorityCheck")
824823
public void saveChunkMetadataChanges(C chunk) {
825824
assert serializationLock.isHeldByCurrentThread();
826825
// chunk's location has to be determined before
@@ -987,7 +986,7 @@ protected final C discoverChunk(long block) {
987986
protected final boolean findLastChunkWithCompleteValidChunkSet(Comparator<C> chunkComparator,
988987
Map<Long, C> validChunksByLocation, boolean afterFullScan) {
989988
// this collection will hold potential candidates for lastChunk to fall back to,
990-
// in order from the most to least likely
989+
// in order from the most to the least likely
991990
C[] array = createChunksArray(validChunksByLocation.size());
992991
C[] lastChunkCandidates = validChunksByLocation.values().toArray(array);
993992
Arrays.sort(lastChunkCandidates, chunkComparator);
@@ -1491,7 +1490,7 @@ private void serializeToBuffer(WriteBuffer buff, ArrayList<Page<?, ?>> changed,
14911490

14921491
// last allocated map id should be captured after the meta map was saved, because
14931492
// this will ensure that concurrently created map, which made it into meta before save,
1494-
// will have it's id reflected in mapid header field of the currently written chunk
1493+
// will have its id reflected in "map" header field of the currently written chunk
14951494
c.mapId = mvStore.getLastMapId();
14961495

14971496
c.tocPos = buff.position();
@@ -1874,7 +1873,7 @@ private static <C extends Chunk<C>> HashSet<Integer> createIdSet(Iterable<C> toC
18741873
return set;
18751874
}
18761875

1877-
public void executeFilestoreOperation(Runnable operation) {
1876+
public void executeFileStoreOperation(Runnable operation) {
18781877
// because serializationExecutor is a single-threaded one and
18791878
// all task submissions to it are done under storeLock,
18801879
// it is guaranteed, that upon this dummy task completion

h2/src/main/org/h2/mvstore/MVStore.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,6 @@ private long store(boolean syncWrite) {
795795
assert storeLock.isHeldByCurrentThread();
796796
if (isOpenOrStopping() && hasUnsavedChanges() && storeOperationInProgress.compareAndSet(false, true)) {
797797
try {
798-
storeOperationInProgress.compareAndSet(false, true);
799798
@SuppressWarnings({"NonAtomicVolatileUpdate", "NonAtomicOperationOnVolatileField"})
800799
long result = ++currentVersion;
801800
if (fileStore == null) {
@@ -920,7 +919,7 @@ public void executeFilestoreOperation(Runnable operation) {
920919
storeLock.lock();
921920
try {
922921
checkNotClosed();
923-
fileStore.executeFilestoreOperation(operation);
922+
fileStore.executeFileStoreOperation(operation);
924923
} catch (MVStoreException e) {
925924
panic(e);
926925
} catch (Throwable e) {

0 commit comments

Comments
 (0)