本文整理匯總了Java中com.facebook.presto.spi.function.Description類的典型用法代碼示例。如果您正苦於以下問題:Java Description類的具體用法?Java Description怎麽用?Java Description使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Description類屬於com.facebook.presto.spi.function包,在下文中一共展示了Description類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: fromWei
import com.facebook.presto.spi.function.Description; //導入依賴的package包/類
@ScalarFunction("fromWei")
@Description("fromWei")
@SqlType(StandardTypes.DOUBLE)
public static double fromWei(@SqlType(StandardTypes.DOUBLE) double num, @SqlType(StandardTypes.VARCHAR) Slice unit) {
String unitStr = unit.toStringUtf8().toUpperCase();
EthereumUnit u = EthereumUnit.valueOf(unitStr);
return u.fromWei(num);
}
示例2: toWei
import com.facebook.presto.spi.function.Description; //導入依賴的package包/類
@ScalarFunction("toWei")
@Description("toWei")
@SqlType(StandardTypes.DOUBLE)
public static double toWei(@SqlType(StandardTypes.DOUBLE) double num, @SqlType(StandardTypes.VARCHAR) Slice unit) {
String unitStr = unit.toStringUtf8().toUpperCase();
EthereumUnit u = EthereumUnit.valueOf(unitStr);
return u.toWei(num);
}
示例3: hllCardinality
import com.facebook.presto.spi.function.Description; //導入依賴的package包/類
@Description("Returns the approximate cardinality of a HLL")
@ScalarFunction("cardinality")
@SqlType(StandardTypes.BIGINT)
public static long hllCardinality(@SqlType(HyperLogLogType.TYPE) Slice hll)
{
return (Long) HyperLogLog.fromBytes(hll.getBytes()).approximateSize().estimate();
}
示例4: hllCreate
import com.facebook.presto.spi.function.Description; //導入依賴的package包/類
@Description("Create a HLL from a string")
@ScalarFunction("hll_create")
@SqlType(HyperLogLogType.TYPE)
public static Slice hllCreate(@SqlType(StandardTypes.VARCHAR) Slice string, @SqlType(StandardTypes.BIGINT) long bits)
{
HyperLogLogMonoid monoid = new HyperLogLogMonoid((int) bits);
DenseHLL hll = monoid.create(string.getBytes()).toDenseHLL();
return Slices.wrappedBuffer(HyperLogLog.toBytes(hll));
}
示例5: bloomFilterFalsePositivePercentage
import com.facebook.presto.spi.function.Description; //導入依賴的package包/類
@Description(value = "Display expected insertions from the bloom filter")
@Nullable
@SqlNullable
@SqlType(StandardTypes.DOUBLE)
public static Double bloomFilterFalsePositivePercentage(@SqlNullable @SqlType(BloomFilterType.TYPE) Slice bloomFilterSlice)
{
BloomFilter bf = getOrLoadBloomFilter(bloomFilterSlice);
return bf.getFalsePositivePercentage();
}
開發者ID:RobinUS2,項目名稱:presto-bloomfilter,代碼行數:10,代碼來源:BloomFilterGetFalsePositivePercentageScalarFunction.java
示例6: ethGasPrice
import com.facebook.presto.spi.function.Description; //導入依賴的package包/類
@ScalarFunction("eth_gasPrice")
@Description("Returns current gas price")
@SqlType(StandardTypes.DOUBLE)
public static double ethGasPrice() throws IOException {
return web3j.ethGasPrice().send().getGasPrice().doubleValue();
}
示例7: ethBlockNumber
import com.facebook.presto.spi.function.Description; //導入依賴的package包/類
@ScalarFunction("eth_blockNumber")
@Description("Returns current block number")
@SqlType(StandardTypes.BIGINT)
public static long ethBlockNumber() throws IOException {
return web3j.ethBlockNumber().send().getBlockNumber().longValue();
}
示例8: ethGetBalance
import com.facebook.presto.spi.function.Description; //導入依賴的package包/類
@ScalarFunction("eth_getBalance")
@Description("Returns the balance of an address")
@SqlType(StandardTypes.DOUBLE)
public static double ethGetBalance(@SqlType(StandardTypes.VARCHAR) Slice address) throws IOException {
return web3j.ethGetBalance(address.toStringUtf8(), DefaultBlockParameter.valueOf(LATEST)).send().getBalance().doubleValue();
}
示例9: ethGetTransactionCount
import com.facebook.presto.spi.function.Description; //導入依賴的package包/類
@ScalarFunction("eth_getTransactionCount")
@Description("Returns the number of transactions from this address")
@SqlType(StandardTypes.BIGINT)
public static long ethGetTransactionCount(@SqlType(StandardTypes.VARCHAR) Slice address) throws IOException {
return web3j.ethGetTransactionCount(address.toStringUtf8(), DefaultBlockParameter.valueOf(LATEST)).send().getTransactionCount().longValue();
}