Package com.alibaba.json.bvt.serializer

Examples of com.alibaba.json.bvt.serializer.ShortFieldSerializerTest$Entity


    private synchronized void updateInternal(EntityType type, Entity entity) throws FalconException {
        try {
            if (get(type, entity.getName()) != null) {
                persist(type, entity);
                ConcurrentHashMap<String, Entity> entityMap = dictionary.get(type);
                Entity oldEntity = entityMap.get(entity.getName());
                onChange(oldEntity, entity);
                entityMap.put(entity.getName(), entity);
            } else {
                throw new FalconException(entity.toShortString() + " doesn't exist");
            }
View Full Code Here


    public boolean remove(EntityType type, String name) throws FalconException {
        Map<String, Entity> entityMap = dictionary.get(type);
        if (entityMap.containsKey(name)) {
            try {
                archive(type, name);
                Entity entity = entityMap.get(name);
                onRemove(entity);
                entityMap.remove(name);
            } catch (IOException e) {
                throw new StoreAccessException(e);
            }
View Full Code Here

    @Override
    //SUSPEND CHECKSTYLE CHECK ParameterNumberCheck
    public void handleRerun(String clusterName, String entityType, String entityName, String nominalTime,
                            String runId, String wfId, String workflowUser, long msgReceivedTime) {
        try {
            Entity entity = getEntity(entityType, entityName);
            Retry retry = getRetry(entity);

            if (retry == null) {
                LOG.warn("Retry not configured for entity:" + entityType + "("
                        + entity.getName() + "), ignoring failed retries");
                return;
            }

            int attempts = retry.getAttempts();
            Frequency delay = retry.getDelay();
View Full Code Here

        String[] pathGroups = falconInPaths.split("#");
        String[] inputFeeds = falconInputFeeds.split("#");
        String[] inputFeedStorageTypes = falconInputFeedStorageTypes.split("#");

        Map<String, Long> computedMetrics = new LinkedHashMap<String, Long>();
        Entity entity = EntityUtil.getEntity(message.getEntityType(), message.getEntityName());
        if (EntityUtil.getLateProcess(entity) != null) {
            List<String> lateFeed = new ArrayList<String>();
            for (LateInput li : EntityUtil.getLateProcess(entity).getLateInputs()) {
                lateFeed.add(li.getInput());
            }
View Full Code Here

                                                                "lateProcess.lateInputs[\\d+].workflowPath", };

    private UpdateHelper() {}

    public static boolean isEntityUpdated(Entity oldEntity, Entity newEntity, String cluster) throws FalconException {
        Entity oldView = EntityUtil.getClusterView(oldEntity, cluster);
        Entity newView = EntityUtil.getClusterView(newEntity, cluster);
        switch (oldEntity.getEntityType()) {
        case FEED:
            return !EntityUtil.equals(oldView, newView, FEED_FIELDS);

        case PROCESS:
View Full Code Here

    @Override
    //SUSPEND CHECKSTYLE CHECK ParameterNumberCheck
    public void handleRerun(String cluster, String entityType, String entityName, String nominalTime,
                            String runId, String wfId, String workflowUser, long msgReceivedTime) {
        try {
            Entity entity = EntityUtil.getEntity(entityType, entityName);
            int intRunId = Integer.parseInt(runId);
            Date msgInsertTime = EntityUtil.parseDateUTC(nominalTime);
            Long wait = getEventDelay(entity, nominalTime);
            if (wait == -1) {
                LOG.info("Late rerun expired for entity: " + entityType + "(" + entityName + ")");
View Full Code Here

                }
                ConcurrentMap<Date, Date> interim =
                        new ConcurrentHashMap<Date, Date>(pendingInstances);
                for (Map.Entry<Date, Date> entry : interim.entrySet()) {
                    if (entry.getValue().before(now)) {
                        Entity entity = getEntity(key);
                        String cluster = getCluster(key);
                        GenericAlert.alertOnLikelySLAMiss(cluster, entity.getEntityType().name(),
                                entity.getName(), SchemaHelper.formatDateUTC(entry.getKey()));
                        LOG.debug("Removing from pending jobs: " + key + " ---> "
                                + SchemaHelper.formatDateUTC(entry.getKey()));
                        pendingInstances.remove(entry.getKey());
                    }
                }
View Full Code Here

        private void addNewPendingEntities(Set<String> keys) throws FalconException {
            Date now = new Date();
            Date windowEndTime = new Date(now.getTime() + POLL_PERIODICITY_SECS * 1000);
            for (String key : keys) {
                Entity entity = getEntity(key);
                String cluster = getCluster(key);
                if (entity == null) {
                    LOG.warn("No entity for " + key);
                    continue;
                }
View Full Code Here

    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);
        }
    }
View Full Code Here

     * @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);
        }
    }
View Full Code Here

TOP

Related Classes of com.alibaba.json.bvt.serializer.ShortFieldSerializerTest$Entity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.