提交 a8983746 authored 作者: noelgrandin's avatar noelgrandin

improve method and field naming "useCompression" -> "isCompressed"

上级 77d964d6
...@@ -375,7 +375,7 @@ public class ValueDataType implements DataType { ...@@ -375,7 +375,7 @@ public class ValueDataType implements DataType {
writeVarInt(buff, lob.getTableId()); writeVarInt(buff, lob.getTableId());
writeVarInt(buff, lob.getObjectId()); writeVarInt(buff, lob.getObjectId());
writeVarLong(buff, lob.getPrecision()); writeVarLong(buff, lob.getPrecision());
buff.put((byte) (lob.useCompression() ? 1 : 0)); buff.put((byte) (lob.isCompressed() ? 1 : 0));
if (t == -2) { if (t == -2) {
buff = writeString(buff, lob.getFileName()); buff = writeString(buff, lob.getFileName());
} }
......
...@@ -616,7 +616,7 @@ public class Data { ...@@ -616,7 +616,7 @@ public class Data {
writeVarInt(lob.getTableId()); writeVarInt(lob.getTableId());
writeVarInt(lob.getObjectId()); writeVarInt(lob.getObjectId());
writeVarLong(lob.getPrecision()); writeVarLong(lob.getPrecision());
writeByte((byte) (lob.useCompression() ? 1 : 0)); writeByte((byte) (lob.isCompressed() ? 1 : 0));
if (t == -2) { if (t == -2) {
writeString(lob.getFileName()); writeString(lob.getFileName());
} }
......
...@@ -339,7 +339,7 @@ public class Recover extends Tool implements DataHandler { ...@@ -339,7 +339,7 @@ public class Recover extends Tool implements DataHandler {
if (small == null) { if (small == null) {
String file = lob.getFileName(); String file = lob.getFileName();
String type = lob.getType() == Value.BLOB ? "BLOB" : "CLOB"; String type = lob.getType() == Value.BLOB ? "BLOB" : "CLOB";
if (lob.useCompression()) { if (lob.isCompressed()) {
dumpLob(file, true); dumpLob(file, true);
file += ".comp"; file += ".comp";
} }
......
...@@ -62,11 +62,11 @@ public class ValueLob extends Value { ...@@ -62,11 +62,11 @@ public class ValueLob extends Value {
private boolean linked; private boolean linked;
private byte[] small; private byte[] small;
private int hash; private int hash;
private boolean compression; private boolean compressed;
private FileStore tempFile; private FileStore tempFile;
private ValueLob(int type, DataHandler handler, String fileName, int tableId, int objectId, boolean linked, private ValueLob(int type, DataHandler handler, String fileName, int tableId, int objectId, boolean linked,
long precision, boolean compression) { long precision, boolean compressed) {
this.type = type; this.type = type;
this.handler = handler; this.handler = handler;
this.fileName = fileName; this.fileName = fileName;
...@@ -74,7 +74,7 @@ public class ValueLob extends Value { ...@@ -74,7 +74,7 @@ public class ValueLob extends Value {
this.objectId = objectId; this.objectId = objectId;
this.linked = linked; this.linked = linked;
this.precision = precision; this.precision = precision;
this.compression = compression; this.compressed = compressed;
} }
private ValueLob(int type, byte[] small) { private ValueLob(int type, byte[] small) {
...@@ -91,7 +91,7 @@ public class ValueLob extends Value { ...@@ -91,7 +91,7 @@ public class ValueLob extends Value {
private static ValueLob copy(ValueLob lob) { private static ValueLob copy(ValueLob lob) {
ValueLob copy = new ValueLob(lob.type, lob.handler, lob.fileName, ValueLob copy = new ValueLob(lob.type, lob.handler, lob.fileName,
lob.tableId, lob.objectId, lob.linked, lob.precision, lob.compression); lob.tableId, lob.objectId, lob.linked, lob.precision, lob.compressed);
copy.small = lob.small; copy.small = lob.small;
copy.hash = lob.hash; copy.hash = lob.hash;
return copy; return copy;
...@@ -396,7 +396,7 @@ public class ValueLob extends Value { ...@@ -396,7 +396,7 @@ public class ValueLob extends Value {
this.small = null; this.small = null;
this.hash = 0; this.hash = 0;
String compressionAlgorithm = h.getLobCompressionAlgorithm(type); String compressionAlgorithm = h.getLobCompressionAlgorithm(type);
this.compression = compressionAlgorithm != null; this.compressed = compressionAlgorithm != null;
synchronized (h) { synchronized (h) {
String path = h.getDatabasePath(); String path = h.getDatabasePath();
if ((path != null) && (path.length() == 0)) { if ((path != null) && (path.length() == 0)) {
...@@ -651,7 +651,7 @@ public class ValueLob extends Value { ...@@ -651,7 +651,7 @@ public class ValueLob extends Value {
} }
FileStore store = handler.openFile(fileName, "r", true); FileStore store = handler.openFile(fileName, "r", true);
boolean alwaysClose = SysProperties.lobCloseBetweenReads; boolean alwaysClose = SysProperties.lobCloseBetweenReads;
return new BufferedInputStream(new FileStoreInputStream(store, handler, compression, alwaysClose), return new BufferedInputStream(new FileStoreInputStream(store, handler, compressed, alwaysClose),
Constants.IO_BUFFER_SIZE); Constants.IO_BUFFER_SIZE);
} }
...@@ -747,8 +747,8 @@ public class ValueLob extends Value { ...@@ -747,8 +747,8 @@ public class ValueLob extends Value {
* *
* @return true if it is * @return true if it is
*/ */
public boolean useCompression() { public boolean isCompressed() {
return compression; return compressed;
} }
private static synchronized void deleteFile(DataHandler handler, String fileName) { private static synchronized void deleteFile(DataHandler handler, String fileName) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论