/** * Validate no extension conflict and extends tuple translator provider * * @param metadataExtension * place holder for tuple translator provider extension * @param mde * user defined metadata extension * @return the metadata extension if the extension defines a metadata tuple translator, null otherwise * @throws RuntimeDataException * if an extension conflict was detected */ public static IMetadataExtension extendTupleTranslatorProvider(IMetadataExtension metadataExtension, IMetadataExtension mde) throws RuntimeDataException { if (metadataExtension != null) { throw new RuntimeDataException(ErrorCode.EXTENSION_COMPONENT_CONFLICT, metadataExtension.getId(), mde.getId(), IMetadataExtension.class.getSimpleName()); } return mde.getMetadataTupleTranslatorProvider() == null ? null : mde; } }
/** * Called on bootstrap of metadata node allowing extensions to instantiate their Metadata artifacts * * @param ncServiceCtx * the node controller service context * @throws HyracksDataException */ public void initializeMetadata(INCServiceContext ncServiceCtx) throws HyracksDataException { if (mdExtensions != null) { for (IMetadataExtension mdExtension : mdExtensions) { try { mdExtension.initializeMetadata(ncServiceCtx); } catch (RemoteException | ACIDException e) { throw HyracksDataException.create(e); } } } } }
public void initialize(INcApplicationContext runtimeContext, MetadataTupleTranslatorProvider tupleTranslatorProvider, List<IMetadataExtension> metadataExtensions, int partitionId) { this.tupleTranslatorProvider = tupleTranslatorProvider; this.transactionSubsystem = runtimeContext.getTransactionSubsystem(); this.datasetLifecycleManager = runtimeContext.getDatasetLifecycleManager(); this.metadataStoragePartition = partitionId; if (metadataExtensions != null) { extensionDatasets = new HashMap<>(); for (IMetadataExtension metadataExtension : metadataExtensions) { for (ExtensionMetadataDataset<?> extensionIndex : metadataExtension.getExtensionIndexes()) { extensionDatasets.put(extensionIndex.getId(), extensionIndex); } } } this.txnIdFactory = new CachingTxnIdFactory(runtimeContext); }
: tupleTranslatorProviderExtension.getMetadataTupleTranslatorProvider();