本文整理汇总了Java中com.ldbc.driver.workloads.ldbc.snb.interactive.LdbcQuery12类的典型用法代码示例。如果您正苦于以下问题:Java LdbcQuery12类的具体用法?Java LdbcQuery12怎么用?Java LdbcQuery12使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LdbcQuery12类属于com.ldbc.driver.workloads.ldbc.snb.interactive包,在下文中一共展示了LdbcQuery12类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onInit
import com.ldbc.driver.workloads.ldbc.snb.interactive.LdbcQuery12; //导入依赖的package包/类
@Override
protected void onInit(Map<String, String> properties, LoggingService loggingService) throws DbException {
try {
// dbs = new JdbcCustomPoolingDbConnectionStore<InteractiveQueryStore>(properties, new InteractiveQueryStore(properties.get("queryDir")));
dbs = new JdbcPoolingDbConnectionStore<InteractiveQueryStore>(properties, new InteractiveQueryStore(properties.get("queryDir")));
} catch (ClassNotFoundException | SQLException e) {
throw new DbException(e);
}
registerOperationHandler(LdbcQuery1.class, Query1.class); //ARRAY RESULT
registerOperationHandler(LdbcQuery2.class, Query2.class);
registerOperationHandler(LdbcQuery3.class, Query3.class);
registerOperationHandler(LdbcQuery4.class, Query4.class);
registerOperationHandler(LdbcQuery5.class, Query5.class);
registerOperationHandler(LdbcQuery6.class, Query6.class);
registerOperationHandler(LdbcQuery7.class, Query7.class);
registerOperationHandler(LdbcQuery8.class, Query8.class);
registerOperationHandler(LdbcQuery9.class, Query9.class);
registerOperationHandler(LdbcQuery10.class, Query10.class);
registerOperationHandler(LdbcQuery11.class, Query11.class);
registerOperationHandler(LdbcQuery12.class, Query12.class); //ARRAY RESULT
registerOperationHandler(LdbcQuery13.class, Query13.class); //NESTED WITH
registerOperationHandler(LdbcQuery14.class, Query14.class); //NESTED WITH
registerOperationHandler(LdbcShortQuery1PersonProfile.class, ShortQuery1PersonProfile.class);
registerOperationHandler(LdbcShortQuery2PersonPosts.class, ShortQuery2PersonPosts.class); //BUG
registerOperationHandler(LdbcShortQuery3PersonFriends.class, ShortQuery3PersonFriends.class);
registerOperationHandler(LdbcShortQuery4MessageContent.class, ShortQuery4MessageContent.class);
registerOperationHandler(LdbcShortQuery5MessageCreator.class, ShortQuery5MessageCreator.class);
registerOperationHandler(LdbcShortQuery6MessageForum.class, ShortQuery6MessageForum.class);
registerOperationHandler(LdbcShortQuery7MessageReplies.class, ShortQuery7MessageReplies.class);
registerOperationHandler(LdbcUpdate1AddPerson.class, Update1AddPerson.class);
registerOperationHandler(LdbcUpdate2AddPostLike.class, Update2AddPostLike.class);
registerOperationHandler(LdbcUpdate3AddCommentLike.class, Update3AddCommentLike.class);
registerOperationHandler(LdbcUpdate4AddForum.class, Update4AddForum.class);
registerOperationHandler(LdbcUpdate5AddForumMembership.class, Update5AddForumMembership.class);
registerOperationHandler(LdbcUpdate6AddPost.class, Update6AddPost.class);
registerOperationHandler(LdbcUpdate7AddComment.class, Update7AddComment.class);
registerOperationHandler(LdbcUpdate8AddFriendship.class, Update8AddFriendship.class);
}
示例2: executeOperation
import com.ldbc.driver.workloads.ldbc.snb.interactive.LdbcQuery12; //导入依赖的package包/类
@Override
public void executeOperation( LdbcQuery12 operation, DummyDbConnectionState dbConnectionState,
ResultReporter resultReporter ) throws DbException
{
sleep( operation, sleepDurationAsNano );
resultReporter.report( 0, LDBC_QUERY_12_RESULTS, operation );
}
示例3: executeOperation
import com.ldbc.driver.workloads.ldbc.snb.interactive.LdbcQuery12; //导入依赖的package包/类
@Override
public void executeOperation(final LdbcQuery12 operation,
DbConnectionState dbConnectionState,
ResultReporter resultReporter) throws DbException {
}
示例4: onInit
import com.ldbc.driver.workloads.ldbc.snb.interactive.LdbcQuery12; //导入依赖的package包/类
@Override
protected void onInit(Map<String, String> properties,
LoggingService loggingService) throws DbException {
connectionState = new Neo4jDbConnectionState(properties);
/*
* Register operation handlers with the benchmark.
*/
registerOperationHandler(LdbcQuery1.class,
LdbcQuery1Handler.class);
registerOperationHandler(LdbcQuery2.class,
LdbcQuery2Handler.class);
registerOperationHandler(LdbcQuery3.class,
LdbcQuery3Handler.class);
registerOperationHandler(LdbcQuery4.class,
LdbcQuery4Handler.class);
registerOperationHandler(LdbcQuery5.class,
LdbcQuery5Handler.class);
registerOperationHandler(LdbcQuery6.class,
LdbcQuery6Handler.class);
registerOperationHandler(LdbcQuery7.class,
LdbcQuery7Handler.class);
registerOperationHandler(LdbcQuery8.class,
LdbcQuery8Handler.class);
registerOperationHandler(LdbcQuery9.class,
LdbcQuery9Handler.class);
registerOperationHandler(LdbcQuery10.class,
LdbcQuery10Handler.class);
registerOperationHandler(LdbcQuery11.class,
LdbcQuery11Handler.class);
registerOperationHandler(LdbcQuery12.class,
LdbcQuery12Handler.class);
registerOperationHandler(LdbcQuery13.class,
LdbcQuery13Handler.class);
registerOperationHandler(LdbcQuery14.class,
LdbcQuery14Handler.class);
registerOperationHandler(LdbcShortQuery1PersonProfile.class,
LdbcShortQuery1PersonProfileHandler.class);
registerOperationHandler(LdbcShortQuery2PersonPosts.class,
LdbcShortQuery2PersonPostsHandler.class);
registerOperationHandler(LdbcShortQuery3PersonFriends.class,
LdbcShortQuery3PersonFriendsHandler.class);
registerOperationHandler(LdbcShortQuery4MessageContent.class,
LdbcShortQuery4MessageContentHandler.class);
registerOperationHandler(LdbcShortQuery5MessageCreator.class,
LdbcShortQuery5MessageCreatorHandler.class);
registerOperationHandler(LdbcShortQuery6MessageForum.class,
LdbcShortQuery6MessageForumHandler.class);
registerOperationHandler(LdbcShortQuery7MessageReplies.class,
LdbcShortQuery7MessageRepliesHandler.class);
registerOperationHandler(LdbcUpdate1AddPerson.class,
LdbcUpdate1AddPersonHandler.class);
registerOperationHandler(LdbcUpdate2AddPostLike.class,
LdbcUpdate2AddPostLikeHandler.class);
registerOperationHandler(LdbcUpdate3AddCommentLike.class,
LdbcUpdate3AddCommentLikeHandler.class);
registerOperationHandler(LdbcUpdate4AddForum.class,
LdbcUpdate4AddForumHandler.class);
registerOperationHandler(LdbcUpdate5AddForumMembership.class,
LdbcUpdate5AddForumMembershipHandler.class);
registerOperationHandler(LdbcUpdate6AddPost.class,
LdbcUpdate6AddPostHandler.class);
registerOperationHandler(LdbcUpdate7AddComment.class,
LdbcUpdate7AddCommentHandler.class);
registerOperationHandler(LdbcUpdate8AddFriendship.class,
LdbcUpdate8AddFriendshipHandler.class);
}
示例5: executeOperation
import com.ldbc.driver.workloads.ldbc.snb.interactive.LdbcQuery12; //导入依赖的package包/类
@Override
public void executeOperation(LdbcQuery12 operation,
DbConnectionState dbConnectionState,
ResultReporter resultReporter) throws DbException {
Driver driver = ((Neo4jDbConnectionState) dbConnectionState).getDriver();
String statement =
" MATCH (:Person {id:{1}})-[:KNOWS]-(friend:Person)"
+ " OPTIONAL MATCH"
+ " (friend)<-[:HAS_CREATOR]-(comment:Comment)-[:REPLY_OF]->(:Post)-[:HAS_TAG]->(tag:Tag),"
+ " (tag)-[:HAS_TYPE]->(tagClass:TagClass)-[:IS_SUBCLASS_OF*0..]->(baseTagClass:TagClass)"
+ " WHERE tagClass.name = {2} OR baseTagClass.name = {2}"
+ " RETURN"
+ " friend.id AS friendId,"
+ " friend.firstName AS friendFirstName,"
+ " friend.lastName AS friendLastName,"
+ " collect(DISTINCT tag.name) AS tagNames,"
+ " count(DISTINCT comment) AS count"
+ " ORDER BY count DESC, toInt(friendId) ASC"
+ " LIMIT {3}";
Value parameters = parameters(
"1", String.valueOf(operation.personId()),
"2", operation.tagClassName(),
"3", operation.limit());
// Execute the query and get the results.
List<LdbcQuery12Result> resultList = new ArrayList<>();
try (Session session = driver.session(AccessMode.READ)) {
try (Transaction tx = session.beginTransaction()) {
StatementResult result = tx.run(statement, parameters);
tx.success();
tx.close();
while (result.hasNext()) {
Record record = result.next();
if (record.get("count").asInt() > 0) {
List<String> tagNames =
record.get("tagNames").asList((e) -> e.asString());
resultList.add(
new LdbcQuery12Result(
Long.valueOf(record.get("friendId").asString()),
record.get("friendFirstName").asString(),
record.get("friendLastName").asString(),
tagNames,
record.get("count").asInt()));
}
}
}
}
resultReporter.report(0, resultList, operation);
}
示例6: getQuery12
import com.ldbc.driver.workloads.ldbc.snb.interactive.LdbcQuery12; //导入依赖的package包/类
public String getQuery12(LdbcQuery12 operation) {
return getSql(QueryType.Query12,
operation.personId(),
operation.tagClassName());
}
示例7: getStmtQuery12
import com.ldbc.driver.workloads.ldbc.snb.interactive.LdbcQuery12; //导入依赖的package包/类
public PreparedStatement getStmtQuery12(LdbcQuery12 operation, Connection con) {
return getStmt(QueryType.Query12, con,
operation.personId(),
operation.tagClassName());
}
示例8: getStatement
import com.ldbc.driver.workloads.ldbc.snb.interactive.LdbcQuery12; //导入依赖的package包/类
@Override
public PreparedStatement getStatement(Connection con, JdbcDbConnectionStore<InteractiveQueryStore> state, LdbcQuery12 operation) {
return state.getQueryStore().getStmtQuery12(operation,con);
}