Skip to content

Commit 5a1d641

Browse files
committed
[cleanup] Binary files do not have pages
1 parent c9730dd commit 5a1d641

File tree

3 files changed

+2
-20
lines changed

3 files changed

+2
-20
lines changed

src/org/exist/dom/persistent/BinaryDocument.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@
4040
* @author wolf
4141
*/
4242
public class BinaryDocument extends DocumentImpl {
43-
44-
private long pageNr = Page.NO_PAGE;
4543
private long realSize = 0L;
4644

4745
public BinaryDocument(final BrokerPool pool) {
@@ -57,14 +55,6 @@ public byte getResourceType() {
5755
return BINARY_FILE;
5856
}
5957

60-
public void setPage(final long page) {
61-
this.pageNr = page;
62-
}
63-
64-
public long getPage() {
65-
return pageNr;
66-
}
67-
6858
@Override
6959
public long getContentLength() {
7060
return realSize;
@@ -78,7 +68,6 @@ public void setContentLength(final long length) {
7868
public void write(final VariableByteOutputStream ostream) throws IOException {
7969
ostream.writeInt(getDocId());
8070
ostream.writeUTF(getFileURI().toString());
81-
ostream.writeLong(pageNr);
8271

8372
getPermissions().write(ostream);
8473

@@ -90,7 +79,6 @@ public void write(final VariableByteOutputStream ostream) throws IOException {
9079
public void read(final VariableByteInput istream) throws IOException {
9180
setDocId(istream.readInt());
9281
setFileURI(XmldbURI.create(istream.readUTF()));
93-
this.pageNr = istream.readLong();
9482

9583
getPermissions().read(istream);
9684

src/org/exist/storage/NativeBroker.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,12 +1639,7 @@ public Object start() {
16391639
new DOMTransaction(this, domDb, LockMode.WRITE_LOCK) {
16401640
@Override
16411641
public Object start() {
1642-
if (doc.getResourceType() == DocumentImpl.BINARY_FILE) {
1643-
final long page = ((BinaryDocument) doc).getPage();
1644-
if (page > Page.NO_PAGE) {
1645-
domDb.removeOverflowValue(transaction, page);
1646-
}
1647-
} else {
1642+
if (doc.getResourceType() == DocumentImpl.XML_FILE) {
16481643
final NodeHandle node = (NodeHandle) doc.getFirstChild();
16491644
domDb.removeAll(transaction, node.getInternalAddress());
16501645
}
@@ -2151,7 +2146,6 @@ public void storeBinaryResource(final Txn transaction, final BinaryDocument blob
21512146
* @param fWriteData A function that given the destination path, writes the document data to that path
21522147
*/
21532148
private void storeBinaryResource(final Txn transaction, final BinaryDocument blob, final ConsumerE<Path, IOException> fWriteData) throws IOException {
2154-
blob.setPage(Page.NO_PAGE);
21552149
final Path binFile = getCollectionFile(getFsDir(), blob.getURI(), true);
21562150
final boolean exists = Files.exists(binFile);
21572151

src/org/exist/storage/index/CollectionStore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
*/
2828
public class CollectionStore extends BFile {
2929

30-
public static final short FILE_FORMAT_VERSION_ID = 13;
30+
public static final short FILE_FORMAT_VERSION_ID = 14;
3131

3232
public static final String FILE_NAME = "collections.dbx";
3333
public static final String FILE_KEY_IN_CONFIG = "db-connection.collections";

0 commit comments

Comments
 (0)