Skip to content

Commit

Permalink
Fixees ambigous variable names, simpler switch
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Reinhart <patrick@reini.net>
  • Loading branch information
reinhapa committed Jan 24, 2024
1 parent cf86b52 commit 0067eaf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public final class MemoryContentsImpl implements MemoryContents {
private static final int NUMBER_OF_BLOCKS = BLOCK_SIZE;

private final int initialBlocks;
private final ReadWriteLock lock;
private final ReadWriteLock readWriteLock;

/**
* To store the contents efficiently we store the first {@value #BLOCK_SIZE}
Expand All @@ -79,7 +79,7 @@ private MemoryContentsImpl(int initialBlocks) {
if (LOG.isDebugEnabled()) {
LOG.debug("Initializing with {} initial blocks", initialBlocks);
}
lock = new ReentrantReadWriteLock();
readWriteLock = new ReentrantReadWriteLock();
initialize();
}

Expand Down Expand Up @@ -136,11 +136,11 @@ private void ensureCapacity(long capacity) {
}

private ManagedLock<ReadWriteLock> readLock() {
return ManagedLock.acquire(lock, Lock.LockMode.READ_LOCK);
return ManagedLock.acquire(readWriteLock, Lock.LockMode.READ_LOCK);
}

private ManagedLock<ReadWriteLock> writeLock() {
return ManagedLock.acquire(lock, Lock.LockMode.WRITE_LOCK);
return ManagedLock.acquire(readWriteLock, Lock.LockMode.WRITE_LOCK);
}

@Override
Expand Down
40 changes: 9 additions & 31 deletions exist-core/src/main/java/org/exist/xmldb/DatabaseImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -395,37 +395,15 @@ public String getProperty(final String property, final String defaultValue) thro
@Override
public void setProperty(final String property, final String value) throws XMLDBException {
switch(property) {
case CREATE_DATABASE:
this.autoCreate = "true".equals(value);
break;

case DATABASE_ID:
this.currentInstanceName = value;
break;

case CONFIGURATION:
this.configuration = value;
break;

case DATA_DIR:
this.dataDir = value;
break;

case JOURNAL_DIR:
this.journalDir = value;
break;

case SSL_ENABLE:
this.ssl_enable = Boolean.valueOf(value);
break;

case SSL_ALLOW_SELF_SIGNED:
this.ssl_allow_self_signed = Boolean.valueOf(value);
break;

case SSL_VERIFY_HOSTNAME:
this.ssl_verify_hostname = Boolean.valueOf(value);
break;
case CREATE_DATABASE -> this.autoCreate = Boolean.parseBoolean(value);
case DATABASE_ID -> this.currentInstanceName = value;
case CONFIGURATION -> this.configuration = value;
case DATA_DIR -> this.dataDir = value;
case JOURNAL_DIR -> this.journalDir = value;
case SSL_ENABLE -> this.ssl_enable = Boolean.valueOf(value);
case SSL_ALLOW_SELF_SIGNED -> this.ssl_allow_self_signed = Boolean.valueOf(value);
case SSL_VERIFY_HOSTNAME -> this.ssl_verify_hostname = Boolean.valueOf(value);
default -> LOG.warn("Ignoring unknown property: {}, value: {} ", property, value);
}
}
}
4 changes: 2 additions & 2 deletions exist-distribution/src/main/config/conf.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1123,14 +1123,14 @@
- max-in-memory-size:
Defines the maximum in memory hold data before storing on temporary disk space
-->
<content-file in-memory-size="4196"/>
<content-file in-memory-size="4194304"/>
<!--
Defines content file pool handling.
- size:
Specifies the maximum pool size of total in memory content file objects. Those could
occupy a maximum of <size> * <maximum in memory size>
-->
<content-file-pool size="10"/>
<content-file-pool size="-1"/>
</rpc-server>
</exist>

0 comments on commit 0067eaf

Please sign in to comment.