com.bigdata.bfs
Interface IContentRepository

All Known Implementing Classes:
BigdataFileSystem

public interface IContentRepository

Document-centric interface for the BigdataFileSystem.

Version:
$Id: IContentRepository.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson

Method Summary
 int create(Document document)
          Create a new persistent document in this repository based on the metadata and content in the supplied document object.
 long delete(String id)
          Delete a single document.
 long deleteAll(String fromId, String toId)
          Delete all documents in the identified key range.
 Iterator<? extends DocumentHeader> getDocumentHeaders(String fromId, String toId)
          Return a listing of the documents and metadata about them in this repository.
 Document read(String id)
          Fetch a single document object based on a URI.
 Iterator<String> search(String query)
          Full text search against the indexed documents.
 int update(Document document)
          Update an existing persistent document in this repository based on the metadata and content in the supplied document object.
 

Method Detail

read

Document read(String id)
Fetch a single document object based on a URI.

Parameters:
id - the identifier of the document to fetch
Returns:
the document -or- null if there is no such document.

create

int create(Document document)
Create a new persistent document in this repository based on the metadata and content in the supplied document object.

Parameters:
document - an object containing the content and metadata to persist
Returns:
The new version.

update

int update(Document document)
Update an existing persistent document in this repository based on the metadata and content in the supplied document object. The document to be updated will be identified by the DocumentHeader.getId() method.

Parameters:
document - an object containing the content and metadata to update
Returns:
The new version.

delete

long delete(String id)
Delete a single document.

Parameters:
id - the identifier of the document to delete
Returns:
The #of blocks that were deleted for that file.

deleteAll

long deleteAll(String fromId,
               String toId)
Delete all documents in the identified key range.

Note: If you assign identifiers using a namespace then you can use this method to rapidly delete all documents within that namespace.

Parameters:
fromId - The identifier of the first document to be deleted or null if there is no lower bound.
toId - The identifier of the first document that will NOT be deleted or null if there is no upper bound.
Returns:
The #of files that were deleted.

getDocumentHeaders

Iterator<? extends DocumentHeader> getDocumentHeaders(String fromId,
                                                      String toId)
Return a listing of the documents and metadata about them in this repository.

Note: If you assign identifiers using a namespace then you can use this method to efficiently visit all documents within that namespace.

Parameters:
fromId - The identifier of the first document to be visited or null if there is no lower bound.
toId - The identifier of the first document that will NOT be visited or null if there is no upper bound.
Returns:
an iterator of DocumentHeaders.

search

Iterator<String> search(String query)
Full text search against the indexed documents.

Parameters:
query - A query.
Returns:
An iterator visiting the identifiers of the documents in order of decreasing relevance to the query.
TODO:
return more metadata about the search results., allow fromId, toId to restrict to a given namespace?, register analyzers against MIME types and index those that are selected on index or update., refactor out of this API since more than one free text index could be used over the repo.


Copyright © 2006-2011 SYSTAP, LLC. All Rights Reserved.