@NotThreadSafe public class ContentStoreFixedBlockReader extends ContentStoreFixedBlock
ContentStore.DocTask
AVERAGE_COMPRESSION_FACTOR, BLOCK_SIZE_BYTES, BYTES_PER_INT, CONSERVATIVE_COMPRESSION_FACTOR, CONTENT_STORE_TYPE_NAME, CONTENTS_FILE_NAME, contentsFile, CURRENT_VERSION, freeBlocks, initialized, MAX_BLOCK_SIZE_BYTES, MAX_COMPRESSION_FACTOR, MINIMUM_ACCEPTABLE_BLOCK_SIZE, nextId, POOL_SIZE, toc, TOC_FILE_NAME, tocFile, tocFileBuffer, tocFileChannel, tocRaf, totalBlocks, TYPICAL_BLOCK_SIZE_CHARACTERS, zipbufPool
dir
Constructor and Description |
---|
ContentStoreFixedBlockReader(File dir) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the entire content store.
|
void |
close()
Close the content store.
|
protected String |
decodeBlock(byte[] buf,
int offset,
int length) |
void |
delete(int id)
Delete a document from the content store.
|
protected void |
mapToc(boolean writable) |
protected void |
performInitialization() |
String |
retrieve(int id)
Retrieve content with given id
|
String[] |
retrieveParts(int contentId,
int[] start,
int[] end)
Retrieve substrings from a document.
|
int |
store(String content)
Store a document.
|
void |
storePart(String content)
Store part of a large document.
|
closeMappedToc, docLength, idSet, initialize, isDeleted, readToc, setStoreType
getStoreTypeVersion, setStoreType, toString
forEachDocument, open, retrievePart
public ContentStoreFixedBlockReader(File dir) throws ErrorOpeningIndex
dir
- content store dirErrorOpeningIndex
protected void performInitialization()
performInitialization
in class ContentStoreFixedBlock
protected void mapToc(boolean writable) throws IOException
mapToc
in class ContentStoreFixedBlock
IOException
public void close()
close
in class ContentStoreFixedBlock
public String retrieve(int id)
retrieve
in class ContentStore
id
- the idpublic String[] retrieveParts(int contentId, int[] start, int[] end)
ContentStore
retrieveParts
in class ContentStore
contentId
- content store document idstart
- start of the substringend
- end of the substringprotected String decodeBlock(byte[] buf, int offset, int length) throws IOException
IOException
public int store(String content)
ContentStore
store
in class ContentStore
content
- (part of) the content of the document to storepublic void storePart(String content)
ContentStore
storePart
in class ContentStore
content
- part of the content of the document to storepublic void clear() throws IOException
ContentStore
clear
in class ContentStore
IOException
public void delete(int id)
ContentStore
delete
in class ContentStore
id
- content store id of the document to deleteCopyright © 2020 Instituut voor Nederlandse Taal (INT). All rights reserved.