public class IndexWriter extends Object implements Closeable
| Constructor and Description |
|---|
IndexWriter(WritableResourceHandler local,
String indexId,
boolean incrementalSupported) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the underlying
ResourceHandler and synchronizes published index properties, so remote clients
becomes able to consume newly published index. |
String |
getChainId()
Returns the chain id of published index.
|
String |
getIndexId()
Returns the index context ID that published index has set.
|
String |
getNextChunkName()
Returns the next chunk name about to be published.
|
Date |
getPublishedTimestamp()
Returns the
Date when index was last published or null if this is first publishing. |
boolean |
isIncremental()
Returns
true if incremental publish is about to happen. |
int |
writeChunk(Iterator<Map<String,String>> iterator)
Writes out the record iterator and returns the written record count.
|
public IndexWriter(WritableResourceHandler local, String indexId, boolean incrementalSupported) throws IOException
IOExceptionpublic String getIndexId()
public Date getPublishedTimestamp()
Date when index was last published or null if this is first publishing. In other
words,returns null when isIncremental() returns false. After this writer is closed, the
return value is updated to "now" (in method.public boolean isIncremental()
true if incremental publish is about to happen.public String getChainId()
isIncremental() is false, this is the newly
generated chain ID.public String getNextChunkName()
public int writeChunk(Iterator<Map<String,String>> iterator) throws IOException
IOExceptionpublic void close()
throws IOException
ResourceHandler and synchronizes published index properties, so remote clients
becomes able to consume newly published index. If sync is not desired (ie. due to aborted publish), then this
method should NOT be invoked, but rather the ResourceHandler that caller provided in constructor of
this class should be closed manually.close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2002–2017 The Apache Software Foundation. All rights reserved.