修改密码

请输入密码
请输入密码 请输入8-64长度密码 和 email 地址不相同 至少包括数字、大写字母、小写字母、半角符号中的 3 个
请输入密码
提交

修改昵称

当前昵称:
提交

申请证书

证书详情

Please complete this required field.

  • Ultipa Blaze (v4)

Standalone

Please complete this required field.

Please complete this required field.

Please complete this required field.

Please complete this required field.

如果不需要 HDC 服务,则此项留空。

Please complete this required field.

如果不需要 HDC 服务,则此项留空。

Please complete this required field.

Please complete this required field.

所有服务器的MAC地址,由换行符或逗号分隔。

Please complete this required field.

Please complete this required field.

取消
申请
ID
产品
状态
核数
Shard 服务最大数量
Shard 服务最大总核数
HDC 服务最大数量
HDC 服务最大总核数
申请天数
审批日期
过期日期
MAC地址
申请理由
审核信息
关闭
基础信息
  • 用户昵称:
  • 手机号:
  • 公司名称:
  • 公司邮箱:
  • 地区:
  • 语言:
修改密码
申请证书

当前未申请证书.

申请证书
Certificate Issued at Valid until Serial No. File
Serial No. Valid until File

Not having one? Apply now! >>>

ProductName CreateTime ID Price File
ProductName CreateTime ID Price File

No Invoice

v5.0
搜索
    v5.0

      进程与作业

      本节介绍用于管理进程和作业的方法。

      进程

      top()

      获取数据库中全部正在运行的进程。

      参数

      • config: RequestConfig(可选):请求配置。

      返回值

      • List<Process>:获取的进程列表。

      // Retrieves all running processes in the database
      
      List<Process> processes = driver.top();
      for (Process process : processes) {
          System.out.println(process.getProcessId() + " - " + process.getProcessQuery());
      }
      

      1049542 - MATCH p = ()->{1,3}() RETURN p LIMIT 5000
      

      kill()

      终止数据库中正在运行的进程。

      参数

      • processId: String:进程ID;用*可指定全部正在运行的进程。
      • config: RequestConfig(可选):请求配置。

      返回值

      • Response:请求结果。

      // Retrieves all running processes in the database and kills them all
      
      List<Process> processes = driver.top();
      for (Process process : processes) {
          Response response = driver.kill(process.getProcessId());
          System.out.println(process.getProcessId() + " - " + process.getProcessQuery() + " - Kill " + response.getStatus().getCode());
      }
      

      1049607 - MATCH p = ()->{1,3}() RETURN p LIMIT 5000 - Kill SUCCESS
      

      作业

      showJob()

      获取图的全部作业。

      参数

      • id: String(可选):作业ID。
      • config: RequestConfig(可选):请求配置。

      返回值

      • List<Job>:获取的作业列表。

      // Retrieves all failed jobs in the graph 'miniCircle'
      
      RequestConfig requestConfig = new RequestConfig();
      requestConfig.setGraph("miniCircle");
      
      List<Job> jobs = driver.showJob(requestConfig);
      List<Job> failed_jobs = jobs.stream()
      		.filter(job -> "FAILED".equals(job.getStatus()))
      		.collect(Collectors.toList());
      
      if (!failed_jobs.isEmpty()) {
        	for (Job job : failed_jobs) {
          	System.out.println(job.getId() + " - " + job.getType() + " - " + job.getErrMsg());
        }
      } else {
        	System.out.println("No failed jobs");
      }
      

      64 - CREATE_FULLTEXT - Fulltext name already exists.
      56 - CREATE_INDEX - @account.year does not exist.
      55 - CREATE_INDEX - @transfer.year does not exist.
      53 - CREATE_INDEX - String type must set index length.
      40 - CREATE_HDC_GRAPH - The projection aa already existed!
      27 - CREATE_HDC_GRAPH - Hdc server sss not found.
      

      stopJob()

      停止图中一个正在运行的作业。

      参数

      • id: String:待停止的作业ID。
      • config: RequestConfig(可选):请求配置。

      返回值

      • Response:请求结果。

      // Retrieves all running jobs in the graph 'miniCircle' and stops them all
      
      RequestConfig requestConfig = new RequestConfig();
      requestConfig.setGraph("miniCircle");
      
      List<Job> jobs = driver.showJob(requestConfig);
      List<Job> running_jobs = jobs.stream()
      		.filter(job -> "RUNNING".equals(job.getStatus()))
        	    .collect(Collectors.toList());
      
      for (Job running_job : running_jobs) {
        	Response response = driver.stopJob(running_job.getId(), requestConfig);
        	System.out.println(running_job.getId() + " - " + running_job.getType() + " - Stop " + response.getStatus().getCode());
      }
      

      10 - CREATE_FULLTEXT - Stop FAILED
      10_1- CREATE_FULLTEXT - Stop SUCCESS
      10_2 - CREATE_FULLTEXT - Stop SUCCESS
      

      clearJob()

      清除图中一个非正在运行的作业。

      参数

      • id: String:待清除的作业ID。
      • config: RequestConfig(可选):请求配置。

      返回值

      • Response:请求结果。

      // Retrieves all running jobs in the graph 'miniCircle' and stops them all
      
      RequestConfig requestConfig = new RequestConfig();
      requestConfig.setGraph("miniCircle");
      
      List<Job> jobs = driver.showJob(requestConfig);
      List<Job> failed_jobs = jobs.stream()
      		.filter(job -> "FAILED".equals(job.getStatus()))
        		.collect(Collectors.toList());
      
      if (!failed_jobs.isEmpty()) {
        	for (Job job : failed_jobs) {
          	Response response = driver.clearJob(job.getId(), requestConfig);
          	System.out.println("Clear " + job.getId() + " " + response.getStatus().getCode());
        	}
      } else {
       	System.out.println("No failed jobs");
      }
      

      Clear 51 SUCCESS
      Clear 42 SUCCESS
      Clear 26 SUCCESS
      Clear 26_1 SUCCESS
      Clear 17 SUCCESS
      Clear 17_1 SUCCESS
      

      完整示例

      package com.ultipa.www.sdk.api;
      
      import com.google.common.collect.Lists;
      import com.ultipa.sdk.UltipaDriver;
      import com.ultipa.sdk.connect.conf.RequestConfig;
      import com.ultipa.sdk.connect.conf.UltipaConfig;
      import com.ultipa.sdk.operate.entity.*;
      
      import java.util.*;
      import java.util.stream.Collectors;
      
      public class Main {
          public static void main(String[] args) {
              UltipaConfig ultipaConfig = UltipaConfig.config()
                     // URI example: .hosts(Lists.newArrayList("d3026ac361964633986849ec43b84877s.eu-south-1.cloud.ultipa.com:8443"))
                      .hosts(Lists.newArrayList("192.168.1.85:60061","192.168.1.88:60061","192.168.1.87:60061"))
                      .username("<username>")
                      .password("<password>");
      
              UltipaDriver driver = null;
      
              try {
                  driver = new UltipaDriver(ultipaConfig);
      
                  // Retrieves all failed jobs in the graph 'miniCircle'
      
                  RequestConfig requestConfig = new RequestConfig();
                  requestConfig.setGraph("miniCircle");
      
                  List<Job> jobs = driver.showJob(requestConfig);
                  List<Job> failed_jobs = jobs.stream()
                          .filter(job -> "FAILED".equals(job.getStatus()))
                          .collect(Collectors.toList());
      
                  if (!failed_jobs.isEmpty()) {
                      for (Job job : failed_jobs) {
                          System.out.println(job.getId() + " - " + job.getType() + " - " + job.getErrMsg());
                      }
                  } else {
                      System.out.println("No failed jobs");
                  }
      
              } catch (InterruptedException e) {
                  throw new RuntimeException(e);
              } finally {
                  if (driver != null) {
                      driver.close();
                  }
              }
          }
      }
      
      请完成以下信息后可下载此书
      *
      公司名称不能为空
      *
      公司邮箱必须填写
      *
      你的名字必须填写
      *
      你的电话必须填写
      *
      你的电话必须填写