Skip to content

Commit

Permalink
Physiological logging: support for record overflow was removed.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii0lomakin committed Jul 6, 2019
1 parent 2789de8 commit 58cc64d
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 115 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
public interface OCluster {

enum ATTRIBUTES {
NAME, RECORD_GROW_FACTOR, RECORD_OVERFLOW_GROW_FACTOR, CONFLICTSTRATEGY, STATUS, ENCRYPTION
NAME, CONFLICTSTRATEGY, STATUS, ENCRYPTION
}

void configure(int iId, String iClusterName) throws IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,6 @@ public Object set(final OCluster.ATTRIBUTES attribute, final Object value) throw
case NAME:
setNameInternal(stringValue);
break;
case RECORD_GROW_FACTOR:
setRecordGrowFactorInternal(stringValue);
break;
case RECORD_OVERFLOW_GROW_FACTOR:
setRecordOverflowGrowFactorInternal(stringValue);
break;
case CONFLICTSTRATEGY:
setRecordConflictStrategy(stringValue);
break;
Expand Down Expand Up @@ -1436,38 +1430,6 @@ private void setEncryptionInternal(final String iMethod, final String iKey) {
}
}

private void setRecordOverflowGrowFactorInternal(final String stringValue) {
try {
final float growFactor = Float.parseFloat(stringValue);
if (growFactor < 1) {
throw new OPaginatedClusterException(ATTRIBUTES.RECORD_OVERFLOW_GROW_FACTOR + " cannot be less than 1", this);
}

config.recordOverflowGrowFactor = growFactor;
((OClusterBasedStorageConfiguration) storage.getConfiguration()).updateCluster(config);
} catch (final NumberFormatException nfe) {
throw OException.wrapException(new OPaginatedClusterException(
"Invalid value for cluster attribute " + OCluster.ATTRIBUTES.RECORD_OVERFLOW_GROW_FACTOR + " was passed [" + stringValue
+ "]", this), nfe);
}
}

private void setRecordGrowFactorInternal(final String stringValue) {
try {
final float growFactor = Float.parseFloat(stringValue);
if (growFactor < 1) {
throw new OPaginatedClusterException(ATTRIBUTES.RECORD_GROW_FACTOR + " cannot be less than 1", this);
}

config.recordGrowFactor = growFactor;
((OClusterBasedStorageConfiguration) storage.getConfiguration()).updateCluster(config);
} catch (final NumberFormatException nfe) {
throw OException.wrapException(new OPaginatedClusterException(
"Invalid value for cluster attribute " + OCluster.ATTRIBUTES.RECORD_GROW_FACTOR + " was passed [" + stringValue + "]",
this), nfe);
}
}

private void setNameInternal(final String newName) throws IOException {

writeCache.renameFile(fileId, newName + getExtension());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,12 +334,6 @@ public Object set(final ATTRIBUTES attribute, final Object value) throws IOExcep
case NAME:
setNameInternal(stringValue);
break;
case RECORD_GROW_FACTOR:
setRecordGrowFactorInternal(stringValue);
break;
case RECORD_OVERFLOW_GROW_FACTOR:
setRecordOverflowGrowFactorInternal(stringValue);
break;
case CONFLICTSTRATEGY:
setRecordConflictStrategy(stringValue);
break;
Expand Down Expand Up @@ -1435,37 +1429,6 @@ private void setEncryptionInternal(final String iMethod, final String iKey) {
}
}

private void setRecordOverflowGrowFactorInternal(final String stringValue) {
try {
final float growFactor = Float.parseFloat(stringValue);
if (growFactor < 1) {
throw new OPaginatedClusterException(ATTRIBUTES.RECORD_OVERFLOW_GROW_FACTOR + " cannot be less than 1", this);
}

config.recordOverflowGrowFactor = growFactor;
((OClusterBasedStorageConfiguration) storageLocal.getConfiguration()).updateCluster(config);
} catch (final NumberFormatException nfe) {
throw OException.wrapException(new OPaginatedClusterException(
"Invalid value for cluster attribute " + ATTRIBUTES.RECORD_OVERFLOW_GROW_FACTOR + " was passed [" + stringValue + "]",
this), nfe);
}
}

private void setRecordGrowFactorInternal(final String stringValue) {
try {
final float growFactor = Float.parseFloat(stringValue);
if (growFactor < 1) {
throw new OPaginatedClusterException(ATTRIBUTES.RECORD_GROW_FACTOR + " cannot be less than 1", this);
}

config.recordGrowFactor = growFactor;
((OClusterBasedStorageConfiguration) storageLocal.getConfiguration()).updateCluster(config);
} catch (final NumberFormatException nfe) {
throw OException.wrapException(new OPaginatedClusterException(
"Invalid value for cluster attribute " + ATTRIBUTES.RECORD_GROW_FACTOR + " was passed [" + stringValue + "]", this), nfe);
}
}

private void setNameInternal(final String newName) throws IOException {

writeCache.renameFile(fileId, newName + getExtension());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ public OPaginatedClusterV2(final String name, final String dataExtension, final
}

@Override
public void configure(final int id, final String clusterName)
throws IOException {
public void configure(final int id, final String clusterName) throws IOException {
acquireExclusiveLock();
try {
final OContextConfiguration ctxCfg = storage.getConfiguration().getContextConfiguration();
Expand Down Expand Up @@ -325,12 +324,6 @@ public Object set(final ATTRIBUTES attribute, final Object value) throws IOExcep
case NAME:
setNameInternal(stringValue);
break;
case RECORD_GROW_FACTOR:
setRecordGrowFactorInternal(stringValue);
break;
case RECORD_OVERFLOW_GROW_FACTOR:
setRecordOverflowGrowFactorInternal(stringValue);
break;
case CONFLICTSTRATEGY:
setRecordConflictStrategy(stringValue);
break;
Expand Down Expand Up @@ -1395,37 +1388,6 @@ private void init(final OStorageClusterConfiguration config) throws IOException
this.id = config.getId();
}

private void setRecordOverflowGrowFactorInternal(final String stringValue) {
try {
final float growFactor = Float.parseFloat(stringValue);
if (growFactor < 1) {
throw new OPaginatedClusterException(ATTRIBUTES.RECORD_OVERFLOW_GROW_FACTOR + " cannot be less than 1", this);
}

config.recordOverflowGrowFactor = growFactor;
((OClusterBasedStorageConfiguration) storageLocal.getConfiguration()).updateCluster(config);
} catch (final NumberFormatException nfe) {
throw OException.wrapException(new OPaginatedClusterException(
"Invalid value for cluster attribute " + ATTRIBUTES.RECORD_OVERFLOW_GROW_FACTOR + " was passed [" + stringValue + "]",
this), nfe);
}
}

private void setRecordGrowFactorInternal(final String stringValue) {
try {
final float growFactor = Float.parseFloat(stringValue);
if (growFactor < 1) {
throw new OPaginatedClusterException(ATTRIBUTES.RECORD_GROW_FACTOR + " cannot be less than 1", this);
}

config.recordGrowFactor = growFactor;
((OClusterBasedStorageConfiguration) storageLocal.getConfiguration()).updateCluster(config);
} catch (final NumberFormatException nfe) {
throw OException.wrapException(new OPaginatedClusterException(
"Invalid value for cluster attribute " + ATTRIBUTES.RECORD_GROW_FACTOR + " was passed [" + stringValue + "]", this), nfe);
}
}

private void setNameInternal(final String newName) throws IOException {

writeCache.renameFile(fileId, newName + getExtension());
Expand Down

0 comments on commit 58cc64d

Please sign in to comment.