本文整理汇总了Java中com.ldbc.driver.workloads.ldbc.snb.interactive.LdbcQuery10类的典型用法代码示例。如果您正苦于以下问题:Java LdbcQuery10类的具体用法?Java LdbcQuery10怎么用?Java LdbcQuery10使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LdbcQuery10类属于com.ldbc.driver.workloads.ldbc.snb.interactive包,在下文中一共展示了LdbcQuery10类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: executeOperation
import com.ldbc.driver.workloads.ldbc.snb.interactive.LdbcQuery10; //导入依赖的package包/类
@Override
public void executeOperation(LdbcQuery10 operation,
DbConnectionState dbConnectionState,
ResultReporter resultReporter) throws DbException {
Driver driver = ((Neo4jDbConnectionState) dbConnectionState).getDriver();
String statement =
" MATCH (person:Person {id:{1}})-[:KNOWS*2..2]-(friend:Person)-[:IS_LOCATED_IN]->(city:Place)"
+ " WHERE "
+ " ((friend.birthday_month = {2} AND friend.birthday_day >= 21) OR"
+ " (friend.birthday_month = ({2}%12)+1 AND friend.birthday_day < 22))"
+ " AND not(friend=person)"
+ " AND not((friend)-[:KNOWS]-(person))"
+ " WITH DISTINCT friend, city, person"
+ " OPTIONAL MATCH (friend)<-[:HAS_CREATOR]-(post:Post)"
+ " WITH friend, city, collect(post) AS posts, person"
+ " WITH "
+ " friend,"
+ " city,"
+ " length(posts) AS postCount,"
+ " length([p IN posts WHERE (p)-[:HAS_TAG]->(:Tag)<-[:HAS_INTEREST]-(person)]) AS commonPostCount"
+ " RETURN"
+ " friend.id AS personId,"
+ " friend.firstName AS personFirstName,"
+ " friend.lastName AS personLastName,"
+ " friend.gender AS personGender,"
+ " city.name AS personCityName,"
+ " commonPostCount - (postCount - commonPostCount) AS commonInterestScore"
+ " ORDER BY commonInterestScore DESC, toInt(personId) ASC"
+ " LIMIT {3}";
Value parameters = parameters(
"1", String.valueOf(operation.personId()),
"2", operation.month(),
"3", operation.limit());
// Execute the query and get the results.
List<LdbcQuery10Result> 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();
resultList.add(
new LdbcQuery10Result(
Long.valueOf(record.get("personId").asString()),
record.get("personFirstName").asString(),
record.get("personLastName").asString(),
record.get("commonInterestScore").asInt(),
record.get("personGender").asString(),
record.get("personCityName").asString()));
}
}
}
resultReporter.report(0, resultList, operation);
}
示例2: getQuery10
import com.ldbc.driver.workloads.ldbc.snb.interactive.LdbcQuery10; //导入依赖的package包/类
public String getQuery10(LdbcQuery10 operation) {
int nextMonth=operation.month()+1;
if(nextMonth==13) { nextMonth=1;}
return getSql(QueryType.Query10,
operation.personId(),
operation.month(),
nextMonth);
}
示例3: getStmtQuery10
import com.ldbc.driver.workloads.ldbc.snb.interactive.LdbcQuery10; //导入依赖的package包/类
public PreparedStatement getStmtQuery10(LdbcQuery10 operation, Connection con) {
int nextMonth=operation.month()+1;
if(nextMonth==13) { nextMonth=1;}
return getStmt(QueryType.Query10, con,
operation.personId(),
operation.month(),
nextMonth);
}
示例4: onInit
import com.ldbc.driver.workloads.ldbc.snb.interactive.LdbcQuery10; //导入依赖的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);
}
示例5: executeOperation
import com.ldbc.driver.workloads.ldbc.snb.interactive.LdbcQuery10; //导入依赖的package包/类
@Override
public void executeOperation( LdbcQuery10 operation, DummyDbConnectionState dbConnectionState,
ResultReporter resultReporter ) throws DbException
{
sleep( operation, sleepDurationAsNano );
resultReporter.report( 0, LDBC_QUERY_10_RESULTS, operation );
}
示例6: executeOperation
import com.ldbc.driver.workloads.ldbc.snb.interactive.LdbcQuery10; //导入依赖的package包/类
@Override
public void executeOperation(final LdbcQuery10 operation,
DbConnectionState dbConnectionState,
ResultReporter resultReporter) throws DbException {
}
示例7: onInit
import com.ldbc.driver.workloads.ldbc.snb.interactive.LdbcQuery10; //导入依赖的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);
}
示例8: onInit
import com.ldbc.driver.workloads.ldbc.snb.interactive.LdbcQuery10; //导入依赖的package包/类
@Override
protected void onInit(Map<String, String> properties,
LoggingService loggingService) throws DbException {
connectionState = new TorcDbConnectionState(properties);
if (properties.containsKey("txReads")) {
doTransactionalReads = true;
}
/*
* Register operation handlers with the benchmark.
*/
registerOperationHandler(LdbcQuery1.class,
LdbcQuery1Handler.class);
registerOperationHandler(LdbcQuery2.class,
LdbcQuery2Handler.class);
registerOperationHandler(LdbcQuery7.class,
LdbcQuery7Handler.class);
registerOperationHandler(LdbcQuery8.class,
LdbcQuery8Handler.class);
registerOperationHandler(LdbcQuery10.class,
LdbcQuery10Handler.class);
registerOperationHandler(LdbcQuery11.class,
LdbcQuery11Handler.class);
registerOperationHandler(LdbcQuery13.class,
LdbcQuery13Handler.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);
}
示例9: getStatement
import com.ldbc.driver.workloads.ldbc.snb.interactive.LdbcQuery10; //导入依赖的package包/类
@Override
public PreparedStatement getStatement(Connection con, JdbcDbConnectionStore<InteractiveQueryStore> state, LdbcQuery10 operation) {
return state.getQueryStore().getStmtQuery10(operation,con);
}