当前位置: 首页>>代码示例>>Java>>正文


Java Entity.getName方法代码示例

本文整理汇总了Java中org.apache.falcon.entity.v0.Entity.getName方法的典型用法代码示例。如果您正苦于以下问题:Java Entity.getName方法的具体用法?Java Entity.getName怎么用?Java Entity.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.falcon.entity.v0.Entity的用法示例。


在下文中一共展示了Entity.getName方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: submitAndSchedule

import org.apache.falcon.entity.v0.Entity; //导入方法依赖的package包/类
/**
 * Submits a new entity and schedules it immediately
 *
 * @param type
 * @return
 */
public APIResult submitAndSchedule(
        @Context HttpServletRequest request, @Dimension("entityType") @PathParam("type") String type,
        @Dimension("colo") @PathParam("colo") String colo) {
    checkColo(colo);
    try {
        checkSchedulableEntity(type);
        audit(request, "STREAMED_DATA", type, "SUBMIT_AND_SCHEDULE");
        Entity entity = submitInternal(request, type);
        scheduleInternal(type, entity.getName());
        return new APIResult(APIResult.Status.SUCCEEDED,
                entity.getName() + "(" + type + ") scheduled successfully");
    } catch (Throwable e) {
        LOG.error("Unable to submit and schedule ", e);
        throw FalconWebException.newException(e, Response.Status.BAD_REQUEST);
    }
}
 
开发者ID:shaikidris,项目名称:incubator-falcon,代码行数:23,代码来源:AbstractSchedulableEntityManager.java

示例2: getRetry

import org.apache.falcon.entity.v0.Entity; //导入方法依赖的package包/类
public static Retry getRetry(Entity entity) throws FalconException {
    switch (entity.getEntityType()) {
    case FEED:
        if (!RuntimeProperties.get()
                .getProperty("feed.retry.allowed", "true")
                .equalsIgnoreCase("true")) {
            return null;
        }
        Retry retry = new Retry();
        retry.setAttempts(Integer.parseInt(RuntimeProperties.get()
                .getProperty("feed.retry.attempts", "3")));
        retry.setDelay(new Frequency(RuntimeProperties.get().getProperty(
                "feed.retry.frequency", "minutes(5)")));
        retry.setPolicy(PolicyType.fromValue(RuntimeProperties.get()
                .getProperty("feed.retry.policy", "exp-backoff")));
        return retry;
    case PROCESS:
        Process process = (Process) entity;
        return process.getRetry();
    default:
        throw new FalconException("Cannot create Retry for entity:" + entity.getName());
    }
}
 
开发者ID:shaikidris,项目名称:incubator-falcon,代码行数:24,代码来源:EntityUtil.java

示例3: validate

import org.apache.falcon.entity.v0.Entity; //导入方法依赖的package包/类
/**
 * Post an entity XML with entity type. Validates the XML which can be
 * Process, Feed or Dataendpoint
 *
 * @param type
 * @return APIResule -Succeeded or Failed
 */
public APIResult validate(HttpServletRequest request, String type) {
    try {
        EntityType entityType = EntityType.valueOf(type.toUpperCase());
        Entity entity = deserializeEntity(request, entityType);
        validate(entity);
        return new APIResult(APIResult.Status.SUCCEEDED,
                "Validated successfully (" + entityType + ") " + entity.getName());
    } catch (Throwable e) {
        LOG.error("Validation failed for entity (" + type + ") ", e);
        throw FalconWebException.newException(e, Response.Status.BAD_REQUEST);
    }
}
 
开发者ID:shaikidris,项目名称:incubator-falcon,代码行数:20,代码来源:AbstractEntityManager.java

示例4: canRemove

import org.apache.falcon.entity.v0.Entity; //导入方法依赖的package包/类
private void canRemove(Entity entity) throws FalconException {
    Pair<String, EntityType>[] referencedBy = EntityIntegrityChecker.referencedBy(entity);
    if (referencedBy != null && referencedBy.length > 0) {
        StringBuffer messages = new StringBuffer();
        for (Pair<String, EntityType> ref : referencedBy) {
            messages.append(ref).append("\n");
        }
        throw new FalconException(
                entity.getName() + "(" + entity.getEntityType() + ") cant " + "be removed as it is referred by "
                        + messages);
    }
}
 
开发者ID:shaikidris,项目名称:incubator-falcon,代码行数:13,代码来源:AbstractEntityManager.java

示例5: getStagingPath

import org.apache.falcon.entity.v0.Entity; //导入方法依赖的package包/类
public static String getStagingPath(Entity entity) throws FalconException {
    try {
        return "falcon/workflows/" + entity.getEntityType().name().toLowerCase() + "/" + entity.getName() + "/"
                + md5(entity);
    } catch (Exception e) {
        throw new FalconException(e);
    }
}
 
开发者ID:shaikidris,项目名称:incubator-falcon,代码行数:9,代码来源:EntityUtil.java

示例6: getLateProcess

import org.apache.falcon.entity.v0.Entity; //导入方法依赖的package包/类
public static LateProcess getLateProcess(Entity entity)
    throws FalconException {

    switch (entity.getEntityType()) {
    case FEED:
        if (!RuntimeProperties.get()
                .getProperty("feed.late.allowed", "true")
                .equalsIgnoreCase("true")) {
            return null;
        }
        LateProcess lateProcess = new LateProcess();
        lateProcess.setDelay(new Frequency(RuntimeProperties.get()
                .getProperty("feed.late.frequency", "hours(3)")));
        lateProcess.setPolicy(PolicyType.fromValue(RuntimeProperties.get()
                .getProperty("feed.late.policy", "exp-backoff")));
        LateInput lateInput = new LateInput();
        lateInput.setInput(entity.getName());
        //TODO - Assuming the late workflow is not used
        lateInput.setWorkflowPath("ignore.xml");
        lateProcess.getLateInputs().add(lateInput);
        return lateProcess;
    case PROCESS:
        Process process = (Process) entity;
        return process.getLateProcess();
    default:
        throw new FalconException("Cannot create Late Process for entity:" + entity.getName());
    }
}
 
开发者ID:shaikidris,项目名称:incubator-falcon,代码行数:29,代码来源:EntityUtil.java

示例7: persist

import org.apache.falcon.entity.v0.Entity; //导入方法依赖的package包/类
/**
 * @param type   - Entity type that is to be stored into persistent storage
 * @param entity - entity to persist. JAXB Annotated entity will be marshalled
 *               to the persistent store. The convention used for storing the
 *               object:: PROP(config.store.uri)/{entitytype}/{entityname}.xml
 * @throws java.io.IOException If any error in accessing the storage
 * @throws FalconException
 */
private void persist(EntityType type, Entity entity) throws IOException, FalconException {
    OutputStream out = fs
            .create(new Path(storePath,
                    type + Path.SEPARATOR + URLEncoder.encode(entity.getName(), UTF_8) + ".xml"));
    try {
        type.getMarshaller().marshal(entity, out);
        LOG.info("Persisted configuration " + type + "/" + entity.getName());
    } catch (JAXBException e) {
        LOG.error(e);
        throw new StoreAccessException("Unable to serialize the entity object " + type + "/" + entity.getName(), e);
    } finally {
        out.close();
    }
}
 
开发者ID:shaikidris,项目名称:incubator-falcon,代码行数:23,代码来源:ConfigurationStore.java

示例8: getRetention

import org.apache.falcon.entity.v0.Entity; //导入方法依赖的package包/类
protected long getRetention(Entity entity, TimeUnit timeUnit)
    throws FalconException {

    String retention = getRetentionValue(timeUnit);
    try {
        return (Long) EVALUATOR.evaluate("${" + retention + "}",
                Long.class, RESOLVER, RESOLVER);
    } catch (ELException e) {
        throw new FalconException("Unable to evalue retention limit: "
                + retention + " for entity: " + entity.getName());
    }
}
 
开发者ID:shaikidris,项目名称:incubator-falcon,代码行数:13,代码来源:AbstractCleanupHandler.java

示例9: delete

import org.apache.falcon.entity.v0.Entity; //导入方法依赖的package包/类
protected void delete(Cluster cluster, Entity entity, long retention)
    throws FalconException {

    FileStatus[] logs = getAllLogs(cluster, entity);
    long now = System.currentTimeMillis();

    for (FileStatus log : logs) {
        if (now - log.getModificationTime() > retention) {
            try {
                boolean isDeleted = getFileSystem(cluster).delete(
                        log.getPath(), true);
                if (!isDeleted) {
                    LOG.error("Unable to delete path: " + log.getPath());
                } else {
                    LOG.info("Deleted path: " + log.getPath());
                }
                deleteParentIfEmpty(getFileSystem(cluster), log.getPath().getParent());
            } catch (IOException e) {
                throw new FalconException(" Unable to delete log file : "
                        + log.getPath() + " for entity " + entity.getName()
                        + " for cluster: " + cluster.getName(), e);
            }
        } else {
            LOG.info("Retention limit: " + retention
                    + " is less than modification"
                    + (now - log.getModificationTime()) + " for path: "
                    + log.getPath());
        }
    }

}
 
开发者ID:shaikidris,项目名称:incubator-falcon,代码行数:32,代码来源:AbstractCleanupHandler.java

示例10: getLogPath

import org.apache.falcon.entity.v0.Entity; //导入方法依赖的package包/类
@Override
protected Path getLogPath(Entity entity, String stagingPath) {
    Path logPath = new Path(stagingPath, "falcon/workflows/process/"
            + entity.getName() + "/logs/job-*/*");
    return logPath;
}
 
开发者ID:shaikidris,项目名称:incubator-falcon,代码行数:7,代码来源:ProcessCleanupHandler.java

示例11: getLogPath

import org.apache.falcon.entity.v0.Entity; //导入方法依赖的package包/类
@Override
protected Path getLogPath(Entity entity, String stagingPath) {
    Path logPath = new Path(stagingPath, "falcon/workflows/feed/"
            + entity.getName() + "/logs/job-*/*/*");
    return logPath;
}
 
开发者ID:shaikidris,项目名称:incubator-falcon,代码行数:7,代码来源:FeedCleanupHandler.java

示例12: submit

import org.apache.falcon.entity.v0.Entity; //导入方法依赖的package包/类
/**
 * Submit a new entity. Entities can be of type feed, process or data end
 * points. Entity definitions are validated structurally against schema and
 * subsequently for other rules before they are admitted into the system
 * <p/>
 * Entity name acts as the key and an entity once added, can't be added
 * again unless deleted.
 *
 * @param request - Servlet Request
 * @param type    - entity type - feed, process or data end point
 * @param colo    - applicable colo
 * @return result of the operation
 */
public APIResult submit(HttpServletRequest request, String type, String colo) {

    checkColo(colo);
    try {
        audit(request, "STREAMED_DATA", type, "SUBMIT");
        Entity entity = submitInternal(request, type);
        return new APIResult(APIResult.Status.SUCCEEDED, "Submit successful (" + type + ") " + entity.getName());
    } catch (Throwable e) {
        LOG.error("Unable to persist entity object", e);
        throw FalconWebException.newException(e, Response.Status.BAD_REQUEST);
    }
}
 
开发者ID:shaikidris,项目名称:incubator-falcon,代码行数:26,代码来源:AbstractEntityManager.java


注:本文中的org.apache.falcon.entity.v0.Entity.getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。