@NotThreadSafe public class ContentStoreFixedBlockWriter 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 |
---|
ContentStoreFixedBlockWriter(File dir,
boolean create) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Delete all content in the document store
|
void |
close()
Close the content store.
|
void |
delete(int id)
Delete a document from the content store.
|
protected byte[] |
encodeBlock() |
protected void |
mapToc(boolean writeable) |
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.
|
void |
setWriteMapReserve(int writeMapReserve)
Set the size of the write reserve (the amount of space allocated at the end
of the file).
|
int |
store(String content)
Store the given content and assign an id to it.
|
void |
storePart(String content)
Store part of a piece of large content.
|
closeMappedToc, docLength, idSet, initialize, isDeleted, readToc, setStoreType
getStoreTypeVersion, setStoreType, toString
forEachDocument, open, retrievePart
public ContentStoreFixedBlockWriter(File dir, boolean create) throws ErrorOpeningIndex
dir
- content store dircreate
- if true, create a new content storeErrorOpeningIndex
public void setWriteMapReserve(int writeMapReserve)
writeMapReserve
- size of the reserve in bytes.public void clear() throws IOException
clear
in class ContentStore
IOException
protected void mapToc(boolean writeable) throws IOException
mapToc
in class ContentStoreFixedBlock
IOException
public void close()
close
in class ContentStoreFixedBlock
public void storePart(String content)
storePart
in class ContentStore
content
- the content to storepublic int store(String content)
store
in class ContentStore
content
- the content to storepublic 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 substringpublic void delete(int id)
ContentStore
delete
in class ContentStore
id
- content store id of the document to deleteprotected byte[] encodeBlock()
protected void performInitialization()
performInitialization
in class ContentStoreFixedBlock
Copyright © 2020 Instituut voor Nederlandse Taal (INT). All rights reserved.