com.datastax.driver.core.Metadata.fullFunctionName()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(10.5k)|赞(0)|评价(0)|浏览(66)

本文整理了Java中com.datastax.driver.core.Metadata.fullFunctionName()方法的一些代码示例,展示了Metadata.fullFunctionName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Metadata.fullFunctionName()方法的具体详情如下:
包路径:com.datastax.driver.core.Metadata
类名称:Metadata
方法名:fullFunctionName

Metadata.fullFunctionName介绍

[英]Builds the internal name of a function/aggregate, which is similar, but not identical, to the function/aggregate signature. This is only used to generate keys for internal metadata maps (KeyspaceMetadata.functions and. KeyspaceMetadata.aggregates). Note that if simpleName comes from the user, the caller must call handleId on it before passing it to this method. Note that this method does not necessarily generates a valid CQL function signature. Note that argumentTypes can be either a list of strings (schema change events) or a list of DataTypes (function lookup from client code). This method must ensure that both cases produce the same identifier.
[中]生成函数/聚合的内部名称,该名称与函数/聚合签名类似,但不完全相同。这仅用于为内部元数据映射(KeyspaceMetadata.functions和.KeyspaceMetadata.aggregates)生成键。请注意,如果simpleName来自用户,则调用方必须在将其传递给此方法之前对其调用handleId。请注意,此方法不一定生成有效的CQL函数签名。请注意,ArgumentType可以是字符串列表(架构更改事件)或数据类型列表(从客户端代码查找函数)。此方法必须确保两种情况下产生相同的标识符。

代码示例

代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core

private static String makeStateFuncFullName(
  String stateFuncSimpleName, DataType stateType, List<DataType> argumentTypes) {
 List<DataType> args = Lists.newArrayList(stateType);
 args.addAll(argumentTypes);
 return Metadata.fullFunctionName(stateFuncSimpleName, args);
}

代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core

/**
 * Returns the definition of a function in this keyspace.
 *
 * @param name the name of the function.
 * @param argumentTypes the types of the function's arguments.
 * @return the function definition if it exists in this keyspace, {@code null} otherwise.
 */
public FunctionMetadata getFunction(String name, Collection<DataType> argumentTypes) {
 return functions.get(Metadata.fullFunctionName(Metadata.handleId(name), argumentTypes));
}

代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core

/**
 * Returns the definition of an aggregate in this keyspace.
 *
 * @param name the name of the aggregate.
 * @param argumentTypes the types of the aggregate's arguments.
 * @return the aggregate definition if it exists in this keyspace, {@code null} otherwise.
 */
public AggregateMetadata getAggregate(String name, Collection<DataType> argumentTypes) {
 return aggregates.get(Metadata.fullFunctionName(Metadata.handleId(name), argumentTypes));
}

代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core

void add(FunctionMetadata function) {
 String functionName =
   Metadata.fullFunctionName(function.getSimpleName(), function.getArguments().values());
 functions.put(functionName, function);
}

代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core

void add(AggregateMetadata aggregate) {
 String aggregateName =
   Metadata.fullFunctionName(aggregate.getSimpleName(), aggregate.getArgumentTypes());
 aggregates.put(aggregateName, aggregate);
}

代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core

private Map<String, FunctionMetadata> buildFunctions(
  KeyspaceMetadata keyspace,
  List<Row> functionRows,
  VersionNumber cassandraVersion,
  Cluster cluster) {
 Map<String, FunctionMetadata> functions = new LinkedHashMap<String, FunctionMetadata>();
 if (functionRows != null) {
  for (Row functionRow : functionRows) {
   FunctionMetadata function =
     FunctionMetadata.build(keyspace, functionRow, cassandraVersion, cluster);
   if (function != null) {
    String name =
      Metadata.fullFunctionName(function.getSimpleName(), function.getArguments().values());
    functions.put(name, function);
   }
  }
 }
 return functions;
}

代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core

private Map<String, AggregateMetadata> buildAggregates(
  KeyspaceMetadata keyspace,
  List<Row> aggregateRows,
  VersionNumber cassandraVersion,
  Cluster cluster) {
 Map<String, AggregateMetadata> aggregates = new LinkedHashMap<String, AggregateMetadata>();
 if (aggregateRows != null) {
  for (Row aggregateRow : aggregateRows) {
   AggregateMetadata aggregate =
     AggregateMetadata.build(keyspace, aggregateRow, cassandraVersion, cluster);
   if (aggregate != null) {
    String name =
      Metadata.fullFunctionName(aggregate.getSimpleName(), aggregate.getArgumentTypes());
    aggregates.put(name, aggregate);
   }
  }
 }
 return aggregates;
}

代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core

private void updateFunctions(
  Metadata metadata,
  Map<String, FunctionMetadata> oldFunctions,
  Map<String, FunctionMetadata> newFunctions,
  String functionToRebuild) {
 Iterator<FunctionMetadata> it = oldFunctions.values().iterator();
 while (it.hasNext()) {
  FunctionMetadata oldFunction = it.next();
  String oldFunctionName =
    Metadata.fullFunctionName(
      oldFunction.getSimpleName(), oldFunction.getArguments().values());
  if ((functionToRebuild == null || functionToRebuild.equals(oldFunctionName))
    && !newFunctions.containsKey(oldFunctionName)) {
   it.remove();
   metadata.triggerOnFunctionRemoved(oldFunction);
  }
 }
 for (FunctionMetadata newFunction : newFunctions.values()) {
  String newFunctionName =
    Metadata.fullFunctionName(
      newFunction.getSimpleName(), newFunction.getArguments().values());
  FunctionMetadata oldFunction = oldFunctions.put(newFunctionName, newFunction);
  if (oldFunction == null) {
   metadata.triggerOnFunctionAdded(newFunction);
  } else if (!newFunction.equals(oldFunction)) {
   metadata.triggerOnFunctionChanged(newFunction, oldFunction);
  }
 }
}

代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core

private void updateAggregates(
  Metadata metadata,
  Map<String, AggregateMetadata> oldAggregates,
  Map<String, AggregateMetadata> newAggregates,
  String aggregateToRebuild) {
 Iterator<AggregateMetadata> it = oldAggregates.values().iterator();
 while (it.hasNext()) {
  AggregateMetadata oldAggregate = it.next();
  String oldAggregateName =
    Metadata.fullFunctionName(oldAggregate.getSimpleName(), oldAggregate.getArgumentTypes());
  if ((aggregateToRebuild == null || aggregateToRebuild.equals(oldAggregateName))
    && !newAggregates.containsKey(oldAggregateName)) {
   it.remove();
   metadata.triggerOnAggregateRemoved(oldAggregate);
  }
 }
 for (AggregateMetadata newAggregate : newAggregates.values()) {
  String newAggregateName =
    Metadata.fullFunctionName(newAggregate.getSimpleName(), newAggregate.getArgumentTypes());
  AggregateMetadata oldAggregate = oldAggregates.put(newAggregateName, newAggregate);
  if (oldAggregate == null) {
   metadata.triggerOnAggregateAdded(newAggregate);
  } else if (!newAggregate.equals(oldAggregate)) {
   metadata.triggerOnAggregateChanged(newAggregate, oldAggregate);
  }
 }
}

代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core

final FunctionMetadata removedFunction =
  keyspace.removeFunction(
    Metadata.fullFunctionName(scc.targetName, scc.targetSignature));
if (removedFunction != null) {
 executor.submit(
final AggregateMetadata removedAggregate =
  keyspace.removeAggregate(
    Metadata.fullFunctionName(scc.targetName, scc.targetSignature));
if (removedAggregate != null) {
 executor.submit(

代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core

final FunctionMetadata removedFunction =
  keyspace.removeFunction(
    Metadata.fullFunctionName(scc.targetName, scc.targetSignature));
if (removedFunction != null) {
 cluster.executor.submit(
final AggregateMetadata removedAggregate =
  keyspace.removeAggregate(
    Metadata.fullFunctionName(scc.targetName, scc.targetSignature));
if (removedAggregate != null) {
 cluster.executor.submit(

代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core

buildArguments(ksm, argumentNames, argumentTypes, version, cluster);
if (argumentNames.size() != argumentTypes.size()) {
 String fullName = Metadata.fullFunctionName(simpleName, arguments.values());
 logger.error(
   String.format(

代码示例来源:origin: com.yugabyte/cassandra-driver-core

private static String makeStateFuncFullName(String stateFuncSimpleName, DataType stateType, List<DataType> argumentTypes) {
  List<DataType> args = Lists.newArrayList(stateType);
  args.addAll(argumentTypes);
  return Metadata.fullFunctionName(stateFuncSimpleName, args);
}

代码示例来源:origin: io.prestosql.cassandra/cassandra-driver

/**
 * Returns the definition of a function in this keyspace.
 *
 * @param name          the name of the function.
 * @param argumentTypes the types of the function's arguments.
 * @return the function definition if it exists in this keyspace, {@code null} otherwise.
 */
public FunctionMetadata getFunction(String name, Collection<DataType> argumentTypes) {
  return functions.get(Metadata.fullFunctionName(Metadata.handleId(name), argumentTypes));
}

代码示例来源:origin: com.yugabyte/cassandra-driver-core

/**
 * Returns the definition of an aggregate in this keyspace.
 *
 * @param name          the name of the aggregate.
 * @param argumentTypes the types of the aggregate's arguments.
 * @return the aggregate definition if it exists in this keyspace, {@code null} otherwise.
 */
public AggregateMetadata getAggregate(String name, Collection<DataType> argumentTypes) {
  return aggregates.get(Metadata.fullFunctionName(Metadata.handleId(name), argumentTypes));
}

代码示例来源:origin: com.facebook.presto.cassandra/cassandra-driver

/**
 * Returns the definition of a function in this keyspace.
 *
 * @param name          the name of the function.
 * @param argumentTypes the types of the function's arguments.
 * @return the function definition if it exists in this keyspace, {@code null} otherwise.
 */
public FunctionMetadata getFunction(String name, Collection<DataType> argumentTypes) {
  return functions.get(Metadata.fullFunctionName(Metadata.handleId(name), argumentTypes));
}

代码示例来源:origin: com.facebook.presto.cassandra/cassandra-driver

/**
 * Returns the definition of an aggregate in this keyspace.
 *
 * @param name          the name of the aggregate.
 * @param argumentTypes the types of the aggregate's arguments.
 * @return the aggregate definition if it exists in this keyspace, {@code null} otherwise.
 */
public AggregateMetadata getAggregate(String name, Collection<DataType> argumentTypes) {
  return aggregates.get(Metadata.fullFunctionName(Metadata.handleId(name), argumentTypes));
}

代码示例来源:origin: io.prestosql.cassandra/cassandra-driver

/**
 * Returns the definition of an aggregate in this keyspace.
 *
 * @param name          the name of the aggregate.
 * @param argumentTypes the types of the aggregate's arguments.
 * @return the aggregate definition if it exists in this keyspace, {@code null} otherwise.
 */
public AggregateMetadata getAggregate(String name, Collection<DataType> argumentTypes) {
  return aggregates.get(Metadata.fullFunctionName(Metadata.handleId(name), argumentTypes));
}

代码示例来源:origin: com.yugabyte/cassandra-driver-core

/**
 * Returns the definition of a function in this keyspace.
 *
 * @param name          the name of the function.
 * @param argumentTypes the types of the function's arguments.
 * @return the function definition if it exists in this keyspace, {@code null} otherwise.
 */
public FunctionMetadata getFunction(String name, Collection<DataType> argumentTypes) {
  return functions.get(Metadata.fullFunctionName(Metadata.handleId(name), argumentTypes));
}

代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core

finalFuncSimpleName == null
    ? null
    : Metadata.fullFunctionName(finalFuncSimpleName, Collections.singletonList(stateType));
String stateFuncFullName = makeStateFuncFullName(stateFuncSimpleName, stateType, argumentTypes);

相关文章

微信公众号

最新文章

更多