public class ElasticsearchAccessMetadata extends ElasticsearchAccess
| Modifier and Type | Field and Description |
|---|---|
static String |
MAPPING_OBJECT_GROUP_FILE |
static String |
MAPPING_UNIT_FILE |
client, clusterName, default_builder, nodes| Constructor and Description |
|---|
ElasticsearchAccessMetadata(String clusterName,
List<ElasticsearchNode> nodes) |
| Modifier and Type | Method and Description |
|---|---|
int |
addBulkEntryIndex(Map<String,String> indexes,
Integer tenantId,
MetadataDocument<?> document)
Used for iterative reload in restore operation (using bulk).
|
boolean |
addEntryIndex(MetadataDocument<?> document,
Integer tenantId)
Add one VitamDocument to indexation immediately
|
boolean |
addIndex(MetadataCollections collection,
Integer tenantId)
Add a type to an index
|
boolean |
deleteBulkOGEntriesIndexes(List<String> ids,
Integer tenantId)
deleteBulkOGEntriesIndexes
|
void |
deleteBulkUnitsEntriesIndexes(List<String> ids,
Integer tenantId)
deleteBulkUnitEntriesIndexes
|
void |
deleteEntryIndex(MetadataCollections collections,
Integer tenantId,
String type,
String id) |
boolean |
deleteIndex(MetadataCollections collection,
Integer tenantId)
Delete one index
|
void |
insertBulkOGEntriesIndexes(com.mongodb.client.MongoCursor<ObjectGroup> cursor,
Integer tenantId)
create indexes during Object group insert
|
void |
refreshIndex(MetadataCollections collection,
Integer tenantId)
refresh an index
|
protected Result |
search(MetadataCollections collection,
Integer tenantId,
String type,
org.elasticsearch.index.query.QueryBuilder query,
org.elasticsearch.index.query.QueryBuilder filter,
List<org.elasticsearch.search.sort.SortBuilder> sorts,
int offset,
Integer limit,
String scrollId,
Integer scrollTimeout) |
boolean |
updateFullOneOG(MetadataCollections collection,
Integer tenantId,
String id,
ObjectGroup og)
Update one element fully
|
checkConnection, close, createIndexAndAliasIfAliasNotExists, createIndexWithoutAlias, getClient, getClusterName, getInfo, getNodes, getSettings, settings, switchIndexpublic static final String MAPPING_UNIT_FILE
public static final String MAPPING_OBJECT_GROUP_FILE
public ElasticsearchAccessMetadata(String clusterName, List<ElasticsearchNode> nodes) throws VitamException, IOException
clusterName - cluster namenodes - list of elasticsearch nodeVitamException - if nodes list is emptyIOExceptionpublic final boolean deleteIndex(MetadataCollections collection, Integer tenantId)
collection - the working metadata collectiontenantId - the tenant for operationpublic final boolean addIndex(MetadataCollections collection, Integer tenantId)
collection - the working metadata collectiontenantId - the tenant for operationpublic final void refreshIndex(MetadataCollections collection, Integer tenantId)
collection - the workking metadata collectiontenantId - the tenant for operationpublic final boolean addEntryIndex(MetadataDocument<?> document, Integer tenantId)
document - the MetadataDocument for indexingtenantId - the tenant for operationpublic final int addBulkEntryIndex(Map<String,String> indexes, Integer tenantId, MetadataDocument<?> document)
indexes - set of operation indextenantId - the tenant for operationdocument - the MetadataDocument for indexingprotected final Result search(MetadataCollections collection, Integer tenantId, String type, org.elasticsearch.index.query.QueryBuilder query, org.elasticsearch.index.query.QueryBuilder filter, List<org.elasticsearch.search.sort.SortBuilder> sorts, int offset, Integer limit, String scrollId, Integer scrollTimeout) throws MetaDataExecutionException, BadRequestException
collection - tenantId - type - query - as in DSL mode "{ "fieldname" : "value" }" "{ "match" : { "fieldname" : "value" } }" "{ "ids" : { "
values" : [list of id] } }"filter - the filtersorts - the list of sortMetaDataExecutionExceptionBadRequestExceptionpublic final void deleteEntryIndex(MetadataCollections collections, Integer tenantId, String type, String id) throws MetaDataExecutionException, MetaDataNotFoundException
collections - the working collectiontenantId - the tenant for operationtype - the type of document to deleteid - the id of document to deleteMetaDataExecutionException - if query operation exception occurredMetaDataNotFoundException - if item not found when deletingpublic void insertBulkOGEntriesIndexes(com.mongodb.client.MongoCursor<ObjectGroup> cursor, Integer tenantId) throws MetaDataExecutionException
cursor - the MongoCursor of ObjectGrouptenantId - the tenant for operationMetaDataExecutionException - when insert exceptionpublic boolean updateFullOneOG(MetadataCollections collection, Integer tenantId, String id, ObjectGroup og)
collection - tenantId - id - object - full objectpublic boolean deleteBulkOGEntriesIndexes(List<String> ids, Integer tenantId) throws MetaDataExecutionException
Bulk to delete entry indexes
ids - list of ids of OGtenantId - the tenant for operationMetaDataExecutionException - when delete index exception occurredpublic void deleteBulkUnitsEntriesIndexes(List<String> ids, Integer tenantId) throws MetaDataExecutionException
Bulk to delete entry indexes
ids - containing all Unit to be deletetenantId - the tenant of operationMetaDataExecutionException - when delete exception occurredCopyright © 2018 Vitam. All rights reserved.