public class DataProcessingUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
DataProcessingUtils.LockAcquired
This class is to store the lock acquiring states:
- allLocksAcquired: all the locks have been acquired
- primaryLockAcquired: the lock to the primary dataset has been acquired
- joinDataSetLocksAquired: the locks to the join datasets in the existing transforms have been acquired
|
static class |
DataProcessingUtils.TranformLockAcquired |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONTEXTROOT |
static java.lang.String |
ERROR_LOG |
static java.lang.String |
HOST |
static java.lang.String |
PORT |
Constructor and Description |
---|
DataProcessingUtils() |
Modifier and Type | Method and Description |
---|---|
static DataProcessingUtils.LockAcquired |
acquireTransformLocks(javax.portlet.PortletRequest request,
long projectId,
java.lang.String dataSetKey,
boolean onlyConsiderUncommittedTransforms) |
static DataProcessingUtils.LockAcquired |
acquireTransformLocks(javax.portlet.PortletRequest request,
long projectId,
java.lang.String dataSetKey,
boolean onlyConsiderUncommittedTransforms,
java.util.List<Transform> newTransformsToAdd)
Acquires tranform locks, including the locks for the join datasets if any.
|
static DataProcessingUtils.LockAcquired |
acquireTransformLocks(javax.portlet.PortletRequest request,
long projectId,
java.lang.String dataSetKey,
boolean onlyConsiderUncommittedTransforms,
Transform newTransformToAdd) |
static java.util.Map<java.lang.String,java.lang.String> |
buildNotificationProperties(long groupId,
long userId,
java.lang.String dataSetDisplayName) |
static java.util.Map<java.lang.String,java.lang.String> |
buildNotificationProperties(long groupId,
long userId,
java.lang.String projectSpecificCollectionName,
com.oracle.endeca.pdi.concepts.mdex.MdexCollectionIdentifier nativeCollectionId,
java.lang.String dataSetDisplayName) |
static java.util.Map<java.lang.String,java.lang.String> |
buildNotificationProperties(long groupId,
long userId,
java.lang.String projectSpecificCollectionName,
com.oracle.endeca.pdi.concepts.mdex.MdexCollectionIdentifier nativeCollectionId,
java.lang.String dataSetDisplayName,
java.lang.String projectDisplayName) |
static java.util.Map<java.lang.String,java.lang.String> |
buildNotificationProperties(long groupId,
long userId,
java.lang.String projectSpecificCollectionName,
com.oracle.endeca.pdi.concepts.mdex.MdexCollectionIdentifier nativeCollectionId,
java.lang.String dataSetDisplayName,
java.lang.String projectDisplayName,
java.lang.String appWizardUuid) |
static java.util.Map<java.lang.String,java.lang.String> |
buildNotificationProperties(long groupId,
long userId,
java.lang.String projectSpecificCollectionName,
com.oracle.endeca.pdi.concepts.mdex.MdexCollectionIdentifier nativeCollectionId,
java.lang.String dataSetDisplayName,
java.lang.String projectDisplayName,
java.lang.String appWizardUuid,
java.lang.Long transformIndex) |
static java.lang.String |
convertToCollectionIdString(ApiMdexCollectionIdentifier cid)
Converts collection identifier object to its string representation
|
static com.oracle.endeca.pdi.concepts.mdex.MdexCollectionIdentifier |
convertToCommonCollectionId(ApiMdexCollectionIdentifier cid)
Converts collection identifier object from WorkflowManager API to edpCommon's API.
|
static CopyCollectionStatus |
getCollectionCopyStatus(long projectId,
java.lang.String projectSpecificSourceCollectionName)
Ascertains whether a collection copy exists or if a job is currently running to create such a copy for a given source collection.
|
static java.lang.String |
getDataDomainName(java.lang.String responsePath) |
static boolean |
getDataSetInProgressFlag(long projectId,
java.lang.String projectSpecificCollectionName) |
static java.lang.String |
getEndecaServerPath() |
static boolean |
getEndecaServerSSLEnabled() |
static java.lang.String |
getErrorMessage(java.lang.String logPath) |
static java.util.Set<java.lang.String> |
getJoinDataSets(long projectId,
java.lang.String dataSetKey,
boolean onlyConsiderUncommittedTransforms) |
static java.util.List<UserPersistence> |
getPersistedTransformLock(java.lang.String dataSetKey,
long projectId)
Gets the transform lock for the current project data set from the UserPersistence store.
|
static void |
handleEDPFailure(java.lang.String ecid,
java.lang.Throwable exception) |
static void |
handleEDPFailure(Workflow event,
java.lang.Throwable exception) |
static void |
invokeApplyToDataSetWorkflow(long projectId,
java.lang.String projectName,
long userId,
java.lang.String projectSpecificCollectionName,
com.oracle.endeca.pdi.concepts.mdex.MdexCollectionIdentifier targetCollectionId,
java.lang.String dataSetDisplayName,
Workflow event,
long toIndex)
Invokes DP's ApplyTransformToDataSet workflow, which applies a transform script to a previously copied
project-private collection.
|
static void |
invokeCurateDataSetWorkflow(CollectionBaseView dataSetToCurate,
long projectId,
java.lang.String projectName,
long userId,
java.util.Locale locale,
RequestIds requestIds,
Workflow.WorkflowNameEnum workflowName)
Invokes DP's CreateCuratedDataSet, which reloads a Hive source in full (not sampled) into a new
collection, while optionally applying a transform.
|
static void |
invokeDatasetRefreshWorkflow(ApiDatasetRefreshConfig refreshConfig,
java.lang.String persistenceKey,
Workflow event)
Invokes DP's DatasetRefresh workflow, which replaces a public data set with a new one provisioned from a Hive source table.
|
static void |
invokeProvisionOrRefreshWorkflow(ApiEdpWorkflowConfigBase workflowConfig,
java.lang.String persistenceKey,
Workflow event)
Invokes either the ProvisionDataSetFromHive or DatasetRefresh EDP workflow, depending on which type of workflowConfig is specified.
|
static void |
invokeProvisionWorkflow(ApiProvisionDataSetFromHiveConfig provisionConfig,
java.lang.String persistenceKey,
Workflow event)
Invokes DP's ProvisionDataSetFromHive workflow, which creates a new public data set from a Hive source table.
|
static void |
markInvalidAttributesInQueryState(DataSource ds,
java.lang.String dataSetKey)
This method examines each
QueryFunction in the current QueryState that matches the given data set key, and
marks their invalid flags based on the following criteria: (1) If the corresponding attribute cannot be found in the current data set,
mark invalid as true (2) If the corresponding attribute's type does not match the QueryFunction 's attribute
type, mark invalid as true (3) Otherwise, mark invalid as false If any QueryFunction 's invalidity
is altered, the QueryState is updated to reflect that. |
static void |
replaceReloadedDataset(javax.portlet.PortletRequest request,
CollectionBaseView baseView)
For a data set that has been reloaded, switches over to use the replacement collection.
|
static void |
rollbackAppliedTransforms(javax.portlet.PortletRequest request,
java.lang.String dataSetKey) |
static void |
setDataSetInProgressFlag(long projectId,
java.lang.String projectSpecificCollectionName,
boolean onlyConsiderUncommittedTransforms,
boolean inProgress) |
static void |
setTransformsAppliedStatus(long groupId,
java.lang.String dataSetKey,
long toIndex,
boolean apply) |
static java.util.Map<java.lang.String,java.lang.String> |
splitPath(java.lang.String path) |
static void |
updateTransformAttributeMetadata(long projectId,
java.lang.String dataSet,
java.util.Map<java.lang.String,java.lang.Object> metadatas) |
public static final java.lang.String HOST
public static final java.lang.String PORT
public static final java.lang.String CONTEXTROOT
public static final java.lang.String ERROR_LOG
public static java.lang.String getEndecaServerPath() throws javax.portlet.PortletException
javax.portlet.PortletException
public static boolean getEndecaServerSSLEnabled() throws javax.portlet.PortletException
javax.portlet.PortletException
public static java.util.Map<java.lang.String,java.lang.String> splitPath(java.lang.String path)
public static java.lang.String getDataDomainName(java.lang.String responsePath) throws javax.portlet.PortletException
javax.portlet.PortletException
public static java.lang.String getErrorMessage(java.lang.String logPath) throws javax.portlet.PortletException
javax.portlet.PortletException
public static void setTransformsAppliedStatus(long groupId, java.lang.String dataSetKey, long toIndex, boolean apply) throws TransformException
TransformException
public static void markInvalidAttributesInQueryState(DataSource ds, java.lang.String dataSetKey) throws KeyNotFoundException, DataSourceException
QueryFunction
in the current QueryState
that matches the given data set key, and
marks their invalid flags based on the following criteria: (1) If the corresponding attribute cannot be found in the current data set,
mark invalid as true
(2) If the corresponding attribute's type does not match the QueryFunction
's attribute
type, mark invalid as true
(3) Otherwise, mark invalid as false
If any QueryFunction
's invalidity
is altered, the QueryState
is updated to reflect that. This method leaves room for future updates to the logic to determine
if a QueryFunction
is invalid.ds
- dataSetkey
- KeyNotFoundException
DataSourceException
public static void invokeCurateDataSetWorkflow(CollectionBaseView dataSetToCurate, long projectId, java.lang.String projectName, long userId, java.util.Locale locale, RequestIds requestIds, Workflow.WorkflowNameEnum workflowName) throws javax.portlet.PortletException
dataSetToCurate
- the data set to curateprojectId
- numeric identifier of the Studio project within which this transform will runprojectName
- name of this Studio project used in EDP logginguserId
- locale
- requestIds
- workflowName
- java.lang.Exception
- if something goes wrong either setting up or invoking the workflowjavax.portlet.PortletException
public static void invokeApplyToDataSetWorkflow(long projectId, java.lang.String projectName, long userId, java.lang.String projectSpecificCollectionName, com.oracle.endeca.pdi.concepts.mdex.MdexCollectionIdentifier targetCollectionId, java.lang.String dataSetDisplayName, Workflow event, long toIndex) throws java.lang.Exception
projectId
- numeric identifier of the Studio project within which this transform will runprojectName
- name of this Studio project used in EDP loggingprojectSpecificCollectionName
- collection name used by the project to bind to the data set being transformedtargetCollectionId
- the "inventoried"/"native" collection id of a previously copied collection being transformeddataSetDisplayName
- event
- toIndex
- indicates a subset of the transform script to applyjava.lang.Exception
- if something goes wrong either setting up or invoking the workflowpublic static void invokeProvisionWorkflow(ApiProvisionDataSetFromHiveConfig provisionConfig, java.lang.String persistenceKey, Workflow event)
provisionConfig
- persistenceKey
- key for persisting instance-specific progress information about this provisioning attemptevent
- Workflow event in context of this provisioning attemptpublic static void invokeDatasetRefreshWorkflow(ApiDatasetRefreshConfig refreshConfig, java.lang.String persistenceKey, Workflow event)
refreshConfig
- persistenceKey
- key for persisting instance-specific progress information about this refresh attemptevent
- Workflow event in context of this refresh attemptpublic static void invokeProvisionOrRefreshWorkflow(ApiEdpWorkflowConfigBase workflowConfig, java.lang.String persistenceKey, Workflow event)
workflowConfig
- persistenceKey
- key for persisting instance-specific progress information about this workflowevent
- Workflow event in context of this workflowjava.lang.IllegalArgumentException
- if workflowConfig is neither an ApiProvisionDataSetFromHiveConfig nor an ApiDatasetRefreshConfigpublic static CopyCollectionStatus getCollectionCopyStatus(long projectId, java.lang.String projectSpecificSourceCollectionName)
projectId
- a project ID indicating the Studio project (Group)projectSpecificSourceCollectionName
- project-specific (suffixed) collection name used by the projectpublic static void rollbackAppliedTransforms(javax.portlet.PortletRequest request, java.lang.String dataSetKey) throws javax.portlet.PortletException, TransformException
javax.portlet.PortletException
TransformException
public static void replaceReloadedDataset(javax.portlet.PortletRequest request, CollectionBaseView baseView) throws DataSourceException, KeyNotFoundException
request
- baseView
- DataSourceException
KeyNotFoundException
public static java.util.List<UserPersistence> getPersistedTransformLock(java.lang.String dataSetKey, long projectId) throws javax.portlet.PortletException
dataSetKey
- projectId
- javax.portlet.PortletException
public static java.util.Map<java.lang.String,java.lang.String> buildNotificationProperties(long groupId, long userId, java.lang.String dataSetDisplayName)
public static java.util.Map<java.lang.String,java.lang.String> buildNotificationProperties(long groupId, long userId, java.lang.String projectSpecificCollectionName, com.oracle.endeca.pdi.concepts.mdex.MdexCollectionIdentifier nativeCollectionId, java.lang.String dataSetDisplayName)
public static java.util.Map<java.lang.String,java.lang.String> buildNotificationProperties(long groupId, long userId, java.lang.String projectSpecificCollectionName, com.oracle.endeca.pdi.concepts.mdex.MdexCollectionIdentifier nativeCollectionId, java.lang.String dataSetDisplayName, java.lang.String projectDisplayName)
public static java.util.Map<java.lang.String,java.lang.String> buildNotificationProperties(long groupId, long userId, java.lang.String projectSpecificCollectionName, com.oracle.endeca.pdi.concepts.mdex.MdexCollectionIdentifier nativeCollectionId, java.lang.String dataSetDisplayName, java.lang.String projectDisplayName, java.lang.String appWizardUuid)
public static java.util.Map<java.lang.String,java.lang.String> buildNotificationProperties(long groupId, long userId, java.lang.String projectSpecificCollectionName, com.oracle.endeca.pdi.concepts.mdex.MdexCollectionIdentifier nativeCollectionId, java.lang.String dataSetDisplayName, java.lang.String projectDisplayName, java.lang.String appWizardUuid, java.lang.Long transformIndex)
public static boolean getDataSetInProgressFlag(long projectId, java.lang.String projectSpecificCollectionName)
public static void setDataSetInProgressFlag(long projectId, java.lang.String projectSpecificCollectionName, boolean onlyConsiderUncommittedTransforms, boolean inProgress)
public static java.util.Set<java.lang.String> getJoinDataSets(long projectId, java.lang.String dataSetKey, boolean onlyConsiderUncommittedTransforms)
public static DataProcessingUtils.LockAcquired acquireTransformLocks(javax.portlet.PortletRequest request, long projectId, java.lang.String dataSetKey, boolean onlyConsiderUncommittedTransforms, java.util.List<Transform> newTransformsToAdd)
request
- projectId
- dataSetKey
- onlyConsiderUncommittedTransforms
- true: only locks the join datasets in the uncommitted transforms, besides the primary dataset and the join datasets in the newTransformsToAdd list;
false: locks the join datasets in all the transforms (including the committed transforms), besides the primary dataset and the join datasets in the newTransformsToAdd list.newTransformsToAdd
- public static DataProcessingUtils.LockAcquired acquireTransformLocks(javax.portlet.PortletRequest request, long projectId, java.lang.String dataSetKey, boolean onlyConsiderUncommittedTransforms, Transform newTransformToAdd)
public static DataProcessingUtils.LockAcquired acquireTransformLocks(javax.portlet.PortletRequest request, long projectId, java.lang.String dataSetKey, boolean onlyConsiderUncommittedTransforms)
public static void updateTransformAttributeMetadata(long projectId, java.lang.String dataSet, java.util.Map<java.lang.String,java.lang.Object> metadatas)
public static java.lang.String convertToCollectionIdString(ApiMdexCollectionIdentifier cid)
cid
- a collection identifier object used by Workflow Manager APIpublic static com.oracle.endeca.pdi.concepts.mdex.MdexCollectionIdentifier convertToCommonCollectionId(ApiMdexCollectionIdentifier cid)
cid
- a collection identifier object used by Workflow Manager APIpublic static void handleEDPFailure(java.lang.String ecid, java.lang.Throwable exception)
public static void handleEDPFailure(Workflow event, java.lang.Throwable exception)
Copyright 2003, 2014, Oracle and/or its affiliates. All rights reserved.