提交 1db91147 authored 作者: Thomas Mueller's avatar Thomas Mueller

Formatting

上级 3effa5c1
...@@ -137,7 +137,12 @@ abstract class ScriptBase extends Prepared implements DataHandler { ...@@ -137,7 +137,12 @@ abstract class ScriptBase extends Prepared implements DataHandler {
// always use a big buffer, otherwise end-of-block is written a lot // always use a big buffer, otherwise end-of-block is written a lot
out = new BufferedOutputStream(out, Constants.IO_BUFFER_SIZE_COMPRESS); out = new BufferedOutputStream(out, Constants.IO_BUFFER_SIZE_COMPRESS);
} else { } else {
OutputStream o = FileUtils.newOutputStream(file, false); OutputStream o;
try {
o = FileUtils.newOutputStream(file, false);
} catch (IOException e) {
throw DbException.convertIOException(e, null);
}
out = new BufferedOutputStream(o, Constants.IO_BUFFER_SIZE); out = new BufferedOutputStream(o, Constants.IO_BUFFER_SIZE);
out = CompressTool.wrapOutputStream(out, compressionAlgorithm, SCRIPT_SQL); out = CompressTool.wrapOutputStream(out, compressionAlgorithm, SCRIPT_SQL);
} }
......
...@@ -93,7 +93,7 @@ public class FunctionIndex extends BaseIndex { ...@@ -93,7 +93,7 @@ public class FunctionIndex extends BaseIndex {
public long getDiskSpaceUsed() { public long getDiskSpaceUsed() {
return 0; return 0;
} }
public String getPlanSQL() { public String getPlanSQL() {
return "function"; return "function";
} }
......
...@@ -157,10 +157,12 @@ public interface Index extends SchemaObject { ...@@ -157,10 +157,12 @@ public interface Index extends SchemaObject {
long getRowCountApproximation(); long getRowCountApproximation();
/** /**
* @return the estimated number of bytes of disk space used by this page and all child pages. * Get the used disk space for this index.
*
* @return the estimated number of bytes
*/ */
long getDiskSpaceUsed(); long getDiskSpaceUsed();
/** /**
* Compare two rows. * Compare two rows.
* *
......
...@@ -100,7 +100,7 @@ public class MetaIndex extends BaseIndex { ...@@ -100,7 +100,7 @@ public class MetaIndex extends BaseIndex {
public long getDiskSpaceUsed() { public long getDiskSpaceUsed() {
return meta.getDiskSpaceUsed(); return meta.getDiskSpaceUsed();
} }
public String getPlanSQL() { public String getPlanSQL() {
return "meta"; return "meta";
} }
......
...@@ -305,7 +305,7 @@ public class MultiVersionIndex implements Index { ...@@ -305,7 +305,7 @@ public class MultiVersionIndex implements Index {
public long getDiskSpaceUsed() { public long getDiskSpaceUsed() {
return base.getDiskSpaceUsed(); return base.getDiskSpaceUsed();
} }
public Index getBaseIndex() { public Index getBaseIndex() {
return base; return base;
} }
......
...@@ -303,7 +303,7 @@ public class PageBtreeIndex extends PageIndex { ...@@ -303,7 +303,7 @@ public class PageBtreeIndex extends PageIndex {
public long getDiskSpaceUsed() { public long getDiskSpaceUsed() {
return tableData.getDiskSpaceUsed(); return tableData.getDiskSpaceUsed();
} }
public long getRowCount(Session session) { public long getRowCount(Session session) {
return rowCount; return rowCount;
} }
......
...@@ -89,7 +89,9 @@ abstract class PageData extends Page { ...@@ -89,7 +89,9 @@ abstract class PageData extends Page {
abstract void setRowCountStored(int rowCount); abstract void setRowCountStored(int rowCount);
/** /**
* @return the estimated number of bytes of disk space used by this page and all child pages. * Get the used disk space for this index.
*
* @return the estimated number of bytes
*/ */
abstract long getDiskSpaceUsed(); abstract long getDiskSpaceUsed();
...@@ -234,7 +236,7 @@ abstract class PageData extends Page { ...@@ -234,7 +236,7 @@ abstract class PageData extends Page {
// to how much memory a row needs on average // to how much memory a row needs on average
return memoryEstimated; return memoryEstimated;
} }
int getParentPageId() { int getParentPageId() {
return parentPageId; return parentPageId;
} }
......
...@@ -431,7 +431,7 @@ public class PageDataIndex extends PageIndex { ...@@ -431,7 +431,7 @@ public class PageDataIndex extends PageIndex {
PageData root = getPage(rootPageId, 0); PageData root = getPage(rootPageId, 0);
return root.getDiskSpaceUsed(); return root.getDiskSpaceUsed();
} }
public String getCreateSQL() { public String getCreateSQL() {
return null; return null;
} }
......
...@@ -454,7 +454,7 @@ public class PageDataLeaf extends PageData { ...@@ -454,7 +454,7 @@ public class PageDataLeaf extends PageData {
long getDiskSpaceUsed() { long getDiskSpaceUsed() {
return index.getPageStore().getPageSize(); return index.getPageStore().getPageSize();
} }
public void write() { public void write() {
writeData(); writeData();
index.getPageStore().writePage(getPos(), data); index.getPageStore().writePage(getPos(), data);
......
...@@ -120,7 +120,7 @@ public class PageDelegateIndex extends PageIndex { ...@@ -120,7 +120,7 @@ public class PageDelegateIndex extends PageIndex {
public long getDiskSpaceUsed() { public long getDiskSpaceUsed() {
return mainIndex.getDiskSpaceUsed(); return mainIndex.getDiskSpaceUsed();
} }
public void writeRowCount() { public void writeRowCount() {
// ignore // ignore
} }
......
...@@ -235,7 +235,7 @@ public class ScanIndex extends BaseIndex { ...@@ -235,7 +235,7 @@ public class ScanIndex extends BaseIndex {
public long getDiskSpaceUsed() { public long getDiskSpaceUsed() {
return 0; return 0;
} }
public String getPlanSQL() { public String getPlanSQL() {
return table.getSQL() + ".tableScan"; return table.getSQL() + ".tableScan";
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论