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


Java SchemaViolationException.printStackTrace方法代码示例

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


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

示例1: executeOperation

import javax.naming.directory.SchemaViolationException; //导入方法依赖的package包/类
@Override
public void executeOperation(final LdbcShortQuery4MessageContent operation,TitanFTMDb.BasicDbConnectionState dbConnectionState,ResultReporter resultReporter) throws DbException {
    long mid = operation.messageId();
    TitanFTMDb.BasicClient client = dbConnectionState.client();
    Vertex m;
    try {
        logger.debug("Short Query 4 called on message id: {}", mid);
        m = client.getVertex(mid, "Comment");
        if (m==null)
            m = client.getVertex(mid, "Post");

        String content = m.getProperty("content");
        if (content.length() == 0)
            content = m.getProperty("imageFile");
        LdbcShortQuery4MessageContentResult res = new LdbcShortQuery4MessageContentResult(
                content,(Long)m.getProperty("creationDate"));

        resultReporter.report(1, res, operation);
    } catch (SchemaViolationException e) {
    e.printStackTrace();
    resultReporter.report(-1, null, operation);
}

}
 
开发者ID:ldbc,项目名称:ldbc_snb_implementations,代码行数:25,代码来源:LdbcShortQuery4Handler.java

示例2: executeOperation

import javax.naming.directory.SchemaViolationException; //导入方法依赖的package包/类
@Override
public void executeOperation(LdbcUpdate5AddForumMembership operation, TitanFTMDb.BasicDbConnectionState dbConnectionState, ResultReporter reporter) throws DbException {

    TitanFTMDb.BasicClient client = dbConnectionState.client();

    try {
        Vertex forum = client.getVertex(operation.forumId(), "Forum");
        Vertex person = client.getVertex(operation.personId(), "Person");
        if (forum==null)
            logger.error("Forum membership requested for nonexistent forum id {}", operation.forumId());
        if (person==null)
            logger.error("Forum membership requested for nonexistent person {}", operation.personId());

        Map<String, Object> props = new HashMap<>(1);
        props.put("joinDate", operation.joinDate().getTime());
        client.addEdge(forum, person, "hasMember", props);

    } catch (SchemaViolationException e) {
        logger.error("invalid vertex label requested by query update");
        e.printStackTrace();
    }

    reporter.report(0, LdbcNoResult.INSTANCE,operation);
}
 
开发者ID:ldbc,项目名称:ldbc_snb_implementations,代码行数:25,代码来源:LdbcQueryU5Handler.java

示例3: executeOperation

import javax.naming.directory.SchemaViolationException; //导入方法依赖的package包/类
@Override
public void executeOperation(LdbcUpdate8AddFriendship operation, TitanFTMDb.BasicDbConnectionState dbConnectionState, ResultReporter reporter) throws DbException {

    TitanFTMDb.BasicClient client = dbConnectionState.client();
    try {

        Map<String, Object> props = new HashMap<>(1);
        props.put("creationDate", operation.creationDate().getTime());
        Vertex person = client.getVertex(operation.person1Id(), "Person");
        Vertex friend = client.getVertex(operation.person2Id(), "Person");
        client.addEdge(person, friend, "knows", props);

    } catch (SchemaViolationException e) {
        logger.error("invalid vertex label requested by query update");
        e.printStackTrace();
    }

    reporter.report(0, LdbcNoResult.INSTANCE, operation);
}
 
开发者ID:ldbc,项目名称:ldbc_snb_implementations,代码行数:20,代码来源:LdbcQueryU8Handler.java

示例4: executeOperation

import javax.naming.directory.SchemaViolationException; //导入方法依赖的package包/类
@Override
public void executeOperation(LdbcUpdate2AddPostLike operation, TitanFTMDb.BasicDbConnectionState dbConnectionState, ResultReporter reporter) throws DbException {

    TitanFTMDb.BasicClient client = dbConnectionState.client();

    try {
        Vertex person = client.getVertex(operation.personId(), "Person");
        Vertex post = client.getVertex(operation.postId(), "Post");
        Map<String, Object> props = new HashMap<>(1);
        props.put("creationDate", operation.creationDate().getTime());
        client.addEdge(person, post, "likes", props);

    } catch (SchemaViolationException e) {
        logger.error("invalid vertex label requested by query update");
        e.printStackTrace();
    }

    reporter.report(0, LdbcNoResult.INSTANCE,operation);
}
 
开发者ID:ldbc,项目名称:ldbc_snb_implementations,代码行数:20,代码来源:LdbcQueryU2Handler.java

示例5: getFoF

import javax.naming.directory.SchemaViolationException; //导入方法依赖的package包/类
/**
 * Given a person, returns the set of friends and friends of friends
 * , excluding that person
 *
 * @param rootId personID to start from
 * @param client TitanFTMDb.BasicClient to use for root retrieval
 * @return Set<Vertex> of the persons friends and their friends
 */
public Set<Vertex> getFoF(long rootId, TitanFTMDb.BasicClient client) {
    Set<Vertex> res = new HashSet<>();
    Vertex root = null;
    try {
        root = client.getVertex(rootId, "Person");
    } catch (SchemaViolationException e) {
        e.printStackTrace();
    }

    GremlinPipeline<Vertex, Vertex> gp = (new GremlinPipeline<Vertex, Vertex>(root));
    gp.out("knows").aggregate(res)
            .out("knows").aggregate(res).iterate();
    res.remove(root);
    return res;
}
 
开发者ID:ldbc,项目名称:ldbc_snb_implementations,代码行数:24,代码来源:QueryUtils.java

示例6: executeOperation

import javax.naming.directory.SchemaViolationException; //导入方法依赖的package包/类
@Override
public void executeOperation(final LdbcShortQuery1PersonProfile operation,TitanFTMDb.BasicDbConnectionState dbConnectionState,ResultReporter resultReporter) throws DbException {
    List<LdbcQuery1Result> result = new ArrayList<>();
    long person_id = operation.personId();
    TitanFTMDb.BasicClient client = dbConnectionState.client();
    final Vertex root;
    try {
        root = client.getVertex(person_id, "Person");
        logger.debug("Short Query 1 called on person id: {}", person_id);

        Vertex cityV = QueryUtils.getPersonCity(root);
        LdbcShortQuery1PersonProfileResult res = new LdbcShortQuery1PersonProfileResult(
                (String) root.getProperty("firstName"),(String) root.getProperty("lastName"),
                (Long) root.getProperty("birthday"), (String) root.getProperty("locationIP"),
                (String) root.getProperty("browserUsed"),client.getVLocalId((Long)cityV.getId()), (String) root.getProperty("gender"),
                (Long) root.getProperty("creationDate"));

        resultReporter.report(result.size(), res, operation);
    } catch (SchemaViolationException e) {
    e.printStackTrace();
    resultReporter.report(-1, null, operation);
}

}
 
开发者ID:ldbc,项目名称:ldbc_snb_implementations,代码行数:25,代码来源:LdbcShortQuery1Handler.java

示例7: executeOperation

import javax.naming.directory.SchemaViolationException; //导入方法依赖的package包/类
@Override
public void executeOperation(LdbcUpdate3AddCommentLike operation, TitanFTMDb.BasicDbConnectionState dbConnectionState, ResultReporter reporter) throws DbException {

    TitanFTMDb.BasicClient client = dbConnectionState.client();

    try {
        Vertex person = client.getVertex(operation.personId(), "Person");
        Vertex post = client.getVertex(operation.commentId(), "Comment");
        Map<String, Object> props = new HashMap<>(1);
        props.put("creationDate", operation.creationDate().getTime());
        client.addEdge(person, post, "likes", props);

    } catch (SchemaViolationException e) {
        logger.error("invalid vertex label requested by query update");
        e.printStackTrace();
    }


    reporter.report(0, LdbcNoResult.INSTANCE,operation);
}
 
开发者ID:ldbc,项目名称:ldbc_snb_implementations,代码行数:21,代码来源:LdbcQueryU3Handler.java

示例8: executeOperation

import javax.naming.directory.SchemaViolationException; //导入方法依赖的package包/类
@Override
public void executeOperation(final LdbcShortQuery5MessageCreator operation,TitanFTMDb.BasicDbConnectionState dbConnectionState,ResultReporter resultReporter) throws DbException {
    long mid = operation.messageId();
    TitanFTMDb.BasicClient client = dbConnectionState.client();
    Vertex m;
    try {
        logger.debug("Short Query 5 called on message id: {}", mid);
        m = client.getVertex(mid, "Comment");
        if (m==null)
            m = client.getVertex(mid, "Post");

        GremlinPipeline<Vertex,Vertex> gp = new GremlinPipeline<>(m);
        Vertex person = gp.out("hasCreator").next();
        LdbcShortQuery5MessageCreatorResult res = new LdbcShortQuery5MessageCreatorResult(
                    client.getVLocalId((Long)person.getId()),
                    (String) person.getProperty("firstName"),(String) person.getProperty("lastName"));
        resultReporter.report(1, res, operation);

    } catch (SchemaViolationException e) {
    e.printStackTrace();
    resultReporter.report(-1, null, operation);
}

}
 
开发者ID:ldbc,项目名称:ldbc_snb_implementations,代码行数:25,代码来源:LdbcShortQuery5Handler.java

示例9: executeOperation

import javax.naming.directory.SchemaViolationException; //导入方法依赖的package包/类
@Override
public void executeOperation(final LdbcShortQuery6MessageForum operation,TitanFTMDb.BasicDbConnectionState dbConnectionState,ResultReporter resultReporter) throws DbException {
    long mid = operation.messageId();
    TitanFTMDb.BasicClient client = dbConnectionState.client();
    Vertex m;
    try {
        boolean isComment = true;
        logger.debug("Short Query 6 called on message id: {}", mid);
        m = client.getVertex(mid, "Comment");
        if (m==null) {
            m = client.getVertex(mid, "Post");
            isComment = false;
        }

        GremlinPipeline<Vertex,Vertex> gp = new GremlinPipeline<>(m);
        Iterator<Row> qResult;
        if (isComment) {
            qResult = gp.as("start").out("replyOf")
                    .loop("start", QueryUtils.LOOPTRUEFUNC, QueryUtils.LOOPTRUEFUNC).filter(QueryUtils.ONLYPOSTS).as("post")
                    .in("containerOf").as("forum").out("hasModerator").as("person").select();
        } else {

            qResult = gp.in("containerOf").as("forum").out("hasModerator").as("person").select();
        }


        if (!qResult.hasNext())
        {
            logger.error("Unexpected empty set");
            resultReporter.report(-1, new LdbcShortQuery6MessageForumResult(0,"",0,"",""), operation);
        } else {

        Row r = qResult.next();
            Vertex forum = (Vertex)r.getColumn("forum");
            Vertex person = (Vertex)r.getColumn("person");

            LdbcShortQuery6MessageForumResult res = new LdbcShortQuery6MessageForumResult(
                    client.getVLocalId((Long)forum.getId()),
                    (String)forum.getProperty("title"),
                    client.getVLocalId((Long)person.getId()),
                    (String) person.getProperty("firstName"),(String) person.getProperty("lastName"));
            resultReporter.report(1, res, operation); }
    } catch (SchemaViolationException e) {
    e.printStackTrace();
        resultReporter.report(-1, new LdbcShortQuery6MessageForumResult(0,"",0,"",""), operation);

}

}
 
开发者ID:ldbc,项目名称:ldbc_snb_implementations,代码行数:50,代码来源:LdbcShortQuery6Handler.java

示例10: executeOperation

import javax.naming.directory.SchemaViolationException; //导入方法依赖的package包/类
@Override
public void executeOperation(final LdbcQuery7 operation,TitanFTMDb.BasicDbConnectionState dbConnectionState,ResultReporter resultReporter) throws DbException {
    long person_id = operation.personId();
    final int limit = operation.limit();

    logger.debug("Query 7 called on Person id: {}",
            person_id);
    TitanFTMDb.BasicClient client = dbConnectionState.client();

    Vertex root = null;
    try {
        root = client.getVertex(person_id, "Person");
    } catch (SchemaViolationException e) {
        e.printStackTrace();
    }

    GremlinPipeline<Vertex, Vertex> gp = (new GremlinPipeline<>(root));
    Set<Vertex> friends = new HashSet<>();
    gp.out("knows").fill(friends);
    gp = (new GremlinPipeline<>(root));
    Iterable<Row> it = gp.as("root").in("hasCreator").as("post").inE("likes").as("like").outV().as("liker")
            .select();

    Map<Vertex, LdbcQuery7Result> qRes = new HashMap<>();
    for (Row r : it) {
        Vertex post = (Vertex) r.getColumn(1);
        Edge like = (Edge) r.getColumn(2);
        Vertex liker = (Vertex) r.getColumn(3);
        boolean isNotFriend = (!friends.contains(liker));
        long id = client.getVLocalId((Long) liker.getId());
        String fName = liker.getProperty("firstName");
        String lName = liker.getProperty("lastName");
        long lcDate = like.getProperty("creationDate");
        long pcDate = post.getProperty("creationDate");
        long postID = client.getVLocalId((Long) post.getId());
        String content = post.getProperty("content");
        if (content.length() == 0)
            content = post.getProperty("imageFile");

        int latency = (int) ((lcDate - pcDate) / 60000);
        LdbcQuery7Result res = new LdbcQuery7Result(id, fName, lName, lcDate, postID, content, latency, isNotFriend);
        //if liker has res, replace according to recent like, and then lower likeid if time is the same
        if (qRes.containsKey(liker)) {
            LdbcQuery7Result other = qRes.get(liker);
            if (other.likeCreationDate() > res.likeCreationDate())
                continue;
            else if (other.likeCreationDate() == res.likeCreationDate() && other.commentOrPostId() < res.commentOrPostId())
                continue;
        }

        /*it is implied from the fact that the program reached this point that either this person has not been
         recorded in qRes yet or that the current like is more recent or it is as recent as the other but with
         a lower postID */
        qRes.put(liker, res);

    }

    List<LdbcQuery7Result> result = new ArrayList<>(qRes.values());
    Collections.sort(result, new Comparator<LdbcQuery7Result>() {
        @Override
        public int compare(LdbcQuery7Result o1, LdbcQuery7Result o2) {
            if (o1.likeCreationDate() == o2.likeCreationDate())
                return Long.compare(o1.personId(), o2.personId());
            return Long.compare(o2.likeCreationDate(), o1.likeCreationDate());
        }
    });
    if (result.size() > limit)
        result = result.subList(0, limit);

    resultReporter.report(result.size(), result, operation);
}
 
开发者ID:ldbc,项目名称:ldbc_snb_implementations,代码行数:72,代码来源:LdbcQuery7Handler.java

示例11: executeOperation

import javax.naming.directory.SchemaViolationException; //导入方法依赖的package包/类
@Override
public void executeOperation(final LdbcShortQuery7MessageReplies operation,TitanFTMDb.BasicDbConnectionState dbConnectionState,ResultReporter resultReporter) throws DbException {
    long mid = operation.messageId();
    TitanFTMDb.BasicClient client = dbConnectionState.client();
    List<LdbcShortQuery7MessageRepliesResult> result = new ArrayList<>();
    Vertex m;
    try {
        logger.debug("Short Query 7 called on message id: {}", mid);
        m = client.getVertex(mid, "Comment");
        if (m==null)
            m = client.getVertex(mid, "Post");

        GremlinPipeline<Vertex,Vertex> gp = new GremlinPipeline<>(m);
        Iterable<Row> qResult = gp.in("replyOf").as("reply").out("hasCreator").as("person")
                .select().order(new PipeFunction<Pair<Row, Row>, Integer>() {
                    @Override
                    public Integer compute(Pair<Row, Row> argument) {
                        long cid1 = (Long)((Vertex)argument.getA().getColumn("reply")).getId();
                        long cid2 = (Long)((Vertex)argument.getB().getColumn("reply")).getId();
                        if (cid1==cid2)
                        {
                            long aid1 = (Long)((Vertex)argument.getA().getColumn("person")).getId();
                            long aid2 = (Long)((Vertex)argument.getB().getColumn("person")).getId();
                            return Long.compare(aid2,aid1);
                        } else
                            return Long.compare(cid2,cid1);
                    }
                });

        GremlinPipeline<Vertex,Vertex> gpF = new GremlinPipeline<>(m);
        Set<Vertex> friends = new HashSet<>();
        gpF.out("hasCreator").out("knows").fill(friends);

        for (Row r : qResult) {
            Vertex reply = (Vertex) r.getColumn("reply");
            Vertex person = (Vertex) r.getColumn("person");

            String content = reply.getProperty("content");
            if (content.length() == 0)
                content = reply.getProperty("imageFile");

            boolean knows = friends.contains(person);
            LdbcShortQuery7MessageRepliesResult res = new LdbcShortQuery7MessageRepliesResult(
                    client.getVLocalId((Long) reply.getId()),content,(Long)reply.getProperty("creationDate"),
                    client.getVLocalId((Long) person.getId()),
                    (String) person.getProperty("firstName"), (String) person.getProperty("lastName"),knows);
            resultReporter.report(1, result, operation);
            result.add(res);
        }
    } catch (SchemaViolationException e) {
    e.printStackTrace();
    resultReporter.report(-1, new ArrayList<LdbcShortQuery7MessageRepliesResult>(Collections.singletonList(new LdbcShortQuery7MessageRepliesResult(0,"",0,0,"","",false))), operation);
}

}
 
开发者ID:ldbc,项目名称:ldbc_snb_implementations,代码行数:56,代码来源:LdbcShortQuery7Handler.java

示例12: executeOperation

import javax.naming.directory.SchemaViolationException; //导入方法依赖的package包/类
@Override
public void executeOperation(final LdbcQuery8 operation,TitanFTMDb.BasicDbConnectionState dbConnectionState,ResultReporter resultReporter) throws DbException {
    long person_id = operation.personId();
    final int limit = operation.limit();

    logger.debug("Query 8 called on Person id: {}",
            person_id);

    TitanFTMDb.BasicClient client = dbConnectionState.client();
    Vertex root = null;
    try {
        root = client.getVertex(person_id, "Person");
    } catch (SchemaViolationException e) {
        e.printStackTrace();
    }

    GremlinPipeline<Vertex, Vertex> gp = (new GremlinPipeline<>(root));
    Iterable<Row> it = gp.in("hasCreator").in("replyOf").as("comment").out("hasCreator")
            .as("commenter").select();

    List<LdbcQuery8Result> result = new ArrayList<>();
    for (Row r : it) {
        Vertex comment = (Vertex) r.getColumn(0);
        Vertex commenter = (Vertex) r.getColumn(1);
        long id = client.getVLocalId((Long) commenter.getId());
        String fName = commenter.getProperty("firstName");
        String lName = commenter.getProperty("lastName");
        long cDate = comment.getProperty("creationDate");
        long commentID = client.getVLocalId((Long) comment.getId());
        String content = comment.getProperty("content");

        LdbcQuery8Result res = new LdbcQuery8Result(id, fName, lName, cDate, commentID, content);
        result.add(res);

    }


    Collections.sort(result, new Comparator<LdbcQuery8Result>() {
        @Override
        public int compare(LdbcQuery8Result o1, LdbcQuery8Result o2) {
            if (o1.commentCreationDate() == o2.commentCreationDate())
                return Long.compare(o1.commentId(), o2.commentId());
            return Long.compare(o2.commentCreationDate(), o1.commentCreationDate());
        }
    });
    if (result.size() > limit)
        result = result.subList(0, limit);

    resultReporter.report(result.size(), result, operation);
}
 
开发者ID:ldbc,项目名称:ldbc_snb_implementations,代码行数:51,代码来源:LdbcQuery8Handler.java

示例13: executeOperation

import javax.naming.directory.SchemaViolationException; //导入方法依赖的package包/类
@Override
public void executeOperation(final LdbcShortQuery3PersonFriends operation,TitanFTMDb.BasicDbConnectionState dbConnectionState,ResultReporter resultReporter) throws DbException {
    List<LdbcShortQuery3PersonFriendsResult> result = new ArrayList<>();
    long person_id = operation.personId();
    TitanFTMDb.BasicClient client = dbConnectionState.client();
    final Vertex root;
    try {
        root = client.getVertex(person_id, "Person");
        logger.debug("Short Query 3 called on person id: {}", person_id);
        GremlinPipeline<Vertex, Vertex> gp = new GremlinPipeline<>(root);
        Iterable<Row> qResult = gp.outE("knows").as("knowEdge").inV().as("friend").select()
                .order(new PipeFunction<Pair<Row, Row>, Integer>() {
                    @Override
                    public Integer compute(Pair<Row, Row> argument) {
                        long d1 = ((Edge) argument.getA().getColumn("knowEdge")).getProperty("creationDate");
                        long d2 = ((Edge) argument.getB().getColumn("knowEdge")).getProperty("creationDate");
                        if (d1 == d2)
                            return Long.compare((Long) ((Vertex) argument.getA().getColumn("friend")).getId(), (Long) ((Vertex) argument.getB().getColumn("friend")).getId());
                        else
                            return Long.compare(d2, d1);
                    }
                });

        for (Row r : qResult) {
            Vertex friend = (Vertex) r.getColumn("friend");
            Edge knowsE = (Edge) r.getColumn("knowEdge");

            LdbcShortQuery3PersonFriendsResult res = new LdbcShortQuery3PersonFriendsResult(
                    client.getVLocalId((Long) friend.getId()),
                    (String) friend.getProperty("firstName"), (String) friend.getProperty("lastName"),
                    (Long) knowsE.getProperty("creationDate"));

            result.add(res);
        }
        resultReporter.report(result.size(), result, operation);
    } catch (SchemaViolationException e) {
    e.printStackTrace();
    resultReporter.report(-1, null, operation);
}

}
 
开发者ID:ldbc,项目名称:ldbc_snb_implementations,代码行数:42,代码来源:LdbcShortQuery3Handler.java


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