修改密码

请输入密码
请输入密码 请输入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

      HDC图和算法

      本节介绍用于管理HDC图和HDC算法的方法。请注意,这些方法要求数据库部署HDC服务器。

      HDC图

      ShowHDCGraph()

      获取从图创建的全部HDC图。

      参数

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

      返回值

      • []*structs.HDCGraph:获取的HDC图的指针切片。
      • error:包含操作过程中遇到的任何问题的错误对象;如果操作成功,则返回nil

      // Retrieves all HDC graphs of the graph 'miniCircle'
      
      requestConfig := &configuration.RequestConfig{
          Graph: "miniCircle",
      }
      
      hdcGraphs, _ := driver.ShowHDCGraph(requestConfig)
      for _, hdcGraph := range hdcGraphs {
          fmt.Println(hdcGraph.Name, "on", hdcGraph.HDCServerName)
      }
      

      miniCircle_hdc_graph on hdc-server-1
      miniCircle_hdc_graph2 on hdc-server-2
      

      CreateHDCGraphBySchema()

      为图创建一个HDC图。

      参数

      • builder: HDCBuilder: 要创建的HDC图;字段HdcGraphNameHdcServerName必填,NodeSchemaEdgeSchemaSyncTypeDirectionLoadIdIsDefault可选。
      • config: *configuration.RequestConfig(可选):请求配置。

      返回值

      • JobResponse:请求结果。
      • error:包含操作过程中遇到的任何问题的错误对象;如果操作成功,则返回nil

      // Creates an HDC graph named 'test_hdc_graph' for the graph 'miniCircle'
      
      requestConfig := &configuration.RequestConfig{
          Graph: "miniCircle",
      }
      
      response, _ := driver.CreateHDCGraphBySchema(api.HDCBuilder{
          HDCGraphName:  "test_hdc_graph",
          HDCServerName: "hdc-server-1",
          NodeSchema:    map[string][]string{"*": {"*"}},
          EdgeSchema:    map[string][]string{"direct": {"*"}, "review": {"value", "content"}},
          SyncType:      api.STATIC,
      }, requestConfig)
      jobID := response.JobId
      
      time.Sleep(3 * time.Second)
      jobs, _ := driver.ShowJob(jobID, requestConfig)
      for _, job := range jobs {
          fmt.Println(job.Id, "-", job.Status)
      }
      

      28 - FINISHED
      28_1 - FINISHED
      

      DropHDCGraph()

      删除指定的HDC图。

      参数

      • hdcGraphName: string:HDC图名称。
      • config: *configuration.RequestConfig(可选):请求配置。

      返回值

      • Response:请求结果。
      • error:包含操作过程中遇到的任何问题的错误对象;如果操作成功,则返回nil

      // Drops the HDC graph 'miniCircle_hdc_graph2' of the graph 'miniCircle'
      
      requestConfig := &configuration.RequestConfig{
          Graph: "miniCircle",
      }
      
      response, _ := driver.DropHDCGraph("miniCircle_hdc_graph2", requestConfig)
      fmt.Println(response.Status.Code)
      

      SUCCESS
      

      HDC算法

      ShowHDCAlgo()

      获取安装在一台HDC服务器上的全部HDC算法。

      参数

      • hdcServerName: string:HDC服务器名称。
      • config: *configuration.RequestConfig(可选):请求配置。

      返回值

      • []*structs.Algo:获取的HDC算法的指针切片。
      • error:包含操作过程中遇到的任何问题的错误对象;如果操作成功,则返回nil

      // Retrieves all HDC algorithms installed on the HDC server 'hdc-server-1'
      
      algos, _ := driver.ShowHDCAlgo("hdc-server-1", nil)
      
      for _, algo := range algos {
          fmt.Print(algo.Name, " supports writeback type(s): ")
          if algo.WriteSupportType != "" {
              fmt.Print(algo.WriteSupportType)
          } else {
              fmt.Print("None")
          }
          fmt.Println()
      }
      

      fastRP supports writeback type(s): DB,FILE
      schema_overview supports writeback type(s): None
      

      InstallHDCAlgo()

      在一台HDC服务器上安装一个HDC算法。

      参数

      • files: []string:安装文件路径列表,算法包文件(.so)必须,配置文件(.yml)可选。
      • hdcServerName: string:HDC服务器名称。
      • config: *configuration.RequestConfig(可选):请求配置。

      返回值

      • Response:请求结果。
      • error:包含操作过程中遇到的任何问题的错误对象;如果操作成功,则返回nil

      // Installs the HDC algorithm LPA on the HDC server 'hdc-server-1'
      // The files 'libplugin_lpa.so' and 'lpa.yml' are located in the 'algo' folder that is placed in the same directory as the file you executed
      
      response, _ := driver.InstallHDCAlgo([]string{"algo/libplugin_lpa.so", "algo/lpa.yml"}, "hdc-server-1", nil)
      fmt.Println(response.Status.Code)
      

      SUCCESS
      

      UninstallHDCAlgo()

      从一台HDC服务器上卸载一个HDC算法。

      参数

      • algoName: string:算法名称。
      • hdcServerName: string:服务器名称。
      • config: *configuration.RequestConfig(可选):请求配置。

      返回值

      • Response:请求结果。
      • error:包含操作过程中遇到的任何问题的错误对象;如果操作成功,则返回nil

      // Uninstalls the HDC algorithm LPA from the HDC server 'hdc-server-1'
      
      response, _ := driver.UninstallHDCAlgo("lpa", "hdc-server-1", nil)
      fmt.Println(response.Status.Code)
      

      SUCCESS
      

      RollbackHDCAlgo()

      将一台HDC服务器上的一个指定HDC算法回退到上一个版本。

      参数

      • algoName: string:算法名称。
      • hdcServerName: string:HDC服务器名称。
      • config: *configuration.RequestConfig(可选):请求配置。

      返回值

      • Response:请求结果。
      • error:包含操作过程中遇到的任何问题的错误对象;如果操作成功,则返回nil

      // Rolls back the HDC algorithms LPA on the HDC server 'hdc-server-1'
      
      response, _ := driver.RollbackHDCAlgo("lpa", "hdc-server-1", nil)
      fmt.Println(response.Status.Code)
      

      SUCCESS
      

      完整示例

      package main
      
      import (
      	"fmt"
      	"log"
      
      	"github.com/ultipa/ultipa-go-driver/v5/sdk"
      	"github.com/ultipa/ultipa-go-driver/v5/sdk/configuration"
      )
      
      func main() {
      	config := &configuration.UltipaConfig{
      		// URI example:	Hosts: []string{"mqj4zouys.us-east-1.cloud.ultipa.com:60010"},
      		Hosts:    []string{"192.168.1.85:60061", "192.168.1.87:60061", "192.168.1.88:60061"},
      		Username: "<usernmae>",
      		Password: "<password>",
      	}
      
      	driver, err := sdk.NewUltipaDriver(config)
      	if err != nil {
      		log.Fatalln("Failed to connect to Ultipa:", err)
      	}
      
      	// Installs the HDC algorithm LPA on the HDC server 'hdc-server-1'
      	// The files 'libplugin_lpa.so' and 'lpa.yml' are located in the 'algo' folder that is placed in the same directory as the file you executed
      
      	response, _ := driver.InstallHDCAlgo([]string{"algo/libplugin_lpa.so", "algo/lpa.yml"}, "hdc-server-1", nil)
      	fmt.Println(response.Status.Code)
      }
      
      请完成以下信息后可下载此书
      *
      公司名称不能为空
      *
      公司邮箱必须填写
      *
      你的名字必须填写
      *
      你的电话必须填写
      *
      你的电话必须填写
      隐私政策 数据处理协议
      请勾选表示您已阅读并同意。

      Copyright © 2019-2025 北京同心尚科技发展有限公司-保留所有权利 京ICP备19040872号-1