• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Golang Hbase.Text函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/sdming/goh/Hbase.Text函数的典型用法代码示例。如果您正苦于以下问题:Golang Text函数的具体用法?Golang Text怎么用?Golang Text使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了Text函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。

示例1: toHbaseTScan

func toHbaseTScan(scan *TScan) *Hbase.TScan {
	if scan == nil {
		return nil
	}

	if scan.FilterString == "" {
		return &Hbase.TScan{
			StartRow:     Hbase.Text(scan.StartRow),
			StopRow:      Hbase.Text(scan.StopRow),
			Timestamp:    scan.Timestamp,
			Columns:      toHbaseTextList(scan.Columns),
			Caching:      scan.Caching,
			FilterString: nil,
		}
	}

	return &Hbase.TScan{
		StartRow:     Hbase.Text(scan.StartRow),
		StopRow:      Hbase.Text(scan.StopRow),
		Timestamp:    scan.Timestamp,
		Columns:      toHbaseTextList(scan.Columns),
		Caching:      scan.Caching,
		FilterString: Hbase.Text(scan.FilterString),
	}

}
开发者ID:mohanarpit,项目名称:goh,代码行数:26,代码来源:htype.go


示例2: NewTIncrement

func NewTIncrement(table string, row []byte, column string, ammount int64) *Hbase.TIncrement {
	return &Hbase.TIncrement{
		Table:   Hbase.Text(table),
		Row:     Hbase.Text(row),
		Column:  Hbase.Text(column),
		Ammount: ammount,
	}
}
开发者ID:mohanarpit,项目名称:goh,代码行数:8,代码来源:htype.go


示例3: GetRowOrBefore

/**
 * Get the row just before the specified one.
 *
 * @return value for specified row/column
 *
 * Parameters:
 *  - TableName: name of table
 *  - Row: row key
 *  - Family: column name
 */
func (client *HClient) GetRowOrBefore(tableName string, row string, family string) (data []*Hbase.TCell, err error) {
	ret, io, e1 := client.hbase.GetRowOrBefore(Hbase.Text(tableName), Hbase.Text(row), Hbase.Text(family))
	if err = checkHbaseError(io, e1); err != nil {
		return
	}

	data = ret
	return
}
开发者ID:mohanarpit,项目名称:goh,代码行数:19,代码来源:hclient.go


示例4: ScannerOpenWithStopTs

/**
 * Get a scanner on the current table starting and stopping at the
 * specified rows.  ending at the last row in the table.  Return the
 * specified columns.  Only values with the specified timestamp are
 * returned.
 *
 * @return scanner id to be used with other scanner procedures
 *
 * Parameters:
 *  - TableName: name of table
 *  - StartRow: Starting row in table to scan.
 * Send "" (empty string) to start at the first row.
 *  - StopRow: row to stop scanning on. This row is *not* included in the
 * scanner's results
 *  - Columns: columns to scan. If column name is a column family, all
 * columns of the specified column family are returned. It's also possible
 * to pass a regex in the column qualifier.
 *  - Timestamp: timestamp
 *  - Attributes: Scan attributes
 */
func (client *HClient) ScannerOpenWithStopTs(tableName string, startRow []byte, stopRow []byte, columns []string, timestamp int64, attributes map[string]string) (id int32, err error) {
	ret, io, e1 := client.hbase.ScannerOpenWithStopTs(Hbase.Text(tableName), Hbase.Text(startRow), Hbase.Text(stopRow), toHbaseTextList(columns), timestamp, toHbaseTextMap(attributes))
	if err = checkHbaseError(io, e1); err != nil {
		return
	}

	id = int32(ret)
	return
}
开发者ID:mohanarpit,项目名称:goh,代码行数:29,代码来源:hclient.go


示例5: GetVerTs

/**
 * Get the specified number of versions for the specified table,
 * row, and column.  Only versions less than or equal to the specified
 * timestamp will be returned.
 *
 * @return list of cells for specified row/column
 *
 * Parameters:
 *  - TableName: name of table
 *  - Row: row key
 *  - Column: column name
 *  - Timestamp: timestamp
 *  - NumVersions: number of versions to retrieve
 *  - Attributes: Get attributes
 */
func (client *HClient) GetVerTs(tableName string, row []byte, column string, timestamp int64, numVersions int32, attributes map[string]string) (data []*Hbase.TCell, err error) {
	ret, io, e1 := client.hbase.GetVerTs(Hbase.Text(tableName), Hbase.Text(row), Hbase.Text(column), timestamp, numVersions, toHbaseTextMap(attributes))
	if err = checkHbaseError(io, e1); err != nil {
		return
	}

	data = ret
	return
}
开发者ID:mohanarpit,项目名称:goh,代码行数:24,代码来源:hclient.go


示例6: AtomicIncrement

/**
 * Atomically increment the column value specified.  Returns the next value post increment.
 *
 * Parameters:
 *  - TableName: name of table
 *  - Row: row to increment
 *  - Column: name of column
 *  - Value: amount to increment by
 */
func (client *HClient) AtomicIncrement(tableName string, row []byte, column string, value int64) (v int64, err error) {
	ret, io, ia, e1 := client.hbase.AtomicIncrement(Hbase.Text(tableName), Hbase.Text(row), Hbase.Text(column), value)
	if err = checkHbaseArgError(io, ia, e1); err != nil {
		return
	}

	v = ret
	return
}
开发者ID:mohanarpit,项目名称:goh,代码行数:18,代码来源:hclient.go


示例7: GetRowWithColumnsTs

/**
 * Get the specified columns for the specified table and row at the specified
 * timestamp. Returns an empty list if the row does not exist.
 *
 * @return TRowResult containing the row and map of columns to TCells
 *
 * Parameters:
 *  - TableName: name of table
 *  - Row: row key
 *  - Columns: List of columns to return, null for all columns
 *  - Timestamp
 *  - Attributes: Get attributes
 */
func (client *HClient) GetRowWithColumnsTs(tableName string, row []byte, columns []string, timestamp int64, attributes map[string]string) (data []*Hbase.TRowResult, err error) {
	ret, io, e1 := client.hbase.GetRowWithColumnsTs(Hbase.Text(tableName), Hbase.Text(row), toHbaseTextList(columns), timestamp, toHbaseTextMap(attributes))
	if err = checkHbaseError(io, e1); err != nil {
		return
	}

	data = ret
	return
}
开发者ID:mohanarpit,项目名称:goh,代码行数:22,代码来源:hclient.go


示例8: NewMutation

func NewMutation(column string, value []byte) *Hbase.Mutation {
	return &Hbase.Mutation{
		IsDelete:   false,
		WriteToWAL: true,
		Column:     Hbase.Text(column),
		Value:      Hbase.Text(value),
	}

}
开发者ID:mohanarpit,项目名称:goh,代码行数:9,代码来源:htype.go


示例9: ScannerOpenWithPrefix

/**
 * Open a scanner for a given prefix.  That is all rows will have the specified
 * prefix. No other rows will be returned.
 *
 * @return scanner id to use with other scanner calls
 *
 * Parameters:
 *  - TableName: name of table
 *  - StartAndPrefix: the prefix (and thus start row) of the keys you want
 *  - Columns: the columns you want returned
 *  - Attributes: Scan attributes
 */
func (client *HClient) ScannerOpenWithPrefix(tableName string, startAndPrefix []byte, columns []string, attributes map[string]string) (id int32, err error) {
	ret, io, e1 := client.hbase.ScannerOpenWithPrefix(Hbase.Text(tableName), Hbase.Text(startAndPrefix), toHbaseTextList(columns), toHbaseTextMap(attributes))
	if err = checkHbaseError(io, e1); err != nil {
		return
	}

	id = int32(ret)
	return
}
开发者ID:mohanarpit,项目名称:goh,代码行数:21,代码来源:hclient.go


示例10: GetRow

/**
 * Get all the data for the specified table and row at the latest
 * timestamp. Returns an empty list if the row does not exist.
 *
 * @return TRowResult containing the row and map of columns to TCells
 *
 * Parameters:
 *  - TableName: name of table
 *  - Row: row key
 *  - Attributes: Get attributes
 */
func (client *HClient) GetRow(tableName string, row []byte, attributes map[string]string) (data []*Hbase.TRowResult, err error) {
	ret, io, e1 := client.hbase.GetRow(Hbase.Text(tableName), Hbase.Text(row), toHbaseTextMap(attributes))
	if err = checkHbaseError(io, e1); err != nil {
		return
	}

	data = ret
	return
}
开发者ID:mohanarpit,项目名称:goh,代码行数:20,代码来源:hclient.go


示例11: fromMapStr

func fromMapStr(data map[string]string) thrift.TMap {

	var m thrift.TMap
	if data != nil {
		m = thrift.NewTMap(thrift.STRING, thrift.STRING, len(data))
		for k, v := range data {
			m.Set(Hbase.Text(k), Hbase.Text(v))
		}
	}

	return m
}
开发者ID:mohanarpit,项目名称:goh,代码行数:12,代码来源:htype.go


示例12: DeleteTable

/**
 * Deletes a table
 *
 * @throws IOError if table doesn't exist on server or there was some other
 * problem
 *
 * Parameters:
 *  - TableName: name of table to delete
 */
func (client *HClient) DeleteTable(tableName string) (err error) {
	if err = client.Open(); err != nil {
		return
	}

	return checkHbaseError(client.thriftClient.DeleteTable(Hbase.Text(tableName)))
}
开发者ID:mohanarpit,项目名称:goh,代码行数:16,代码来源:hclient.go


示例13: GetColumnDescriptors

/**
 * List all the column families assoicated with a table.
 *
 * @return list of column family descriptors
 *
 * Parameters:
 *  - TableName: table name
 */
func (client *HClient) GetColumnDescriptors(tableName string) (columns map[string]*ColumnDescriptor, err error) {
	ret, io, e1 := client.hbase.GetColumnDescriptors(Hbase.Text(tableName))
	if err = checkHbaseError(io, e1); err != nil {
		return
	}
	columns = toColMap(ret)
	return
}
开发者ID:mohanarpit,项目名称:goh,代码行数:16,代码来源:hclient.go


示例14: CreateTable

/**
 * Create a table with the specified column families.  The name
 * field for each ColumnDescriptor must be set and must end in a
 * colon (:). All other fields are optional and will get default
 * values if not explicitly specified.
 *
 * @throws IllegalArgument if an input parameter is invalid
 *
 * @throws AlreadyExists if the table name already exists
 *
 * Parameters:
 *  - TableName: name of table to create
 *  - ColumnFamilies: list of column family descriptors
 */
func (client *HClient) CreateTable(tableName string, columnFamilies []*ColumnDescriptor) (exists bool, err error) {
	columns := toHbaseColList(columnFamilies)
	io, ia, ex, e1 := client.hbase.CreateTable(Hbase.Text(tableName), columns)
	if err = checkHbaseArgError(io, ia, e1); err != nil {
		return
	}
	exists = (ex != nil)
	return
}
开发者ID:mohanarpit,项目名称:goh,代码行数:23,代码来源:hclient.go


示例15: GetTableRegions

/**
 * List the regions associated with a table.
 *
 * @return list of region descriptors
 *
 * Parameters:
 *  - TableName: table name
 */
func (client *HClient) GetTableRegions(tableName string) (regions []*TRegionInfo, err error) {
	ret, io, e1 := client.hbase.GetTableRegions(Hbase.Text(tableName))
	if err = checkHbaseError(io, e1); err != nil {
		return
	}

	regions = toRegionList(ret)
	return
}
开发者ID:mohanarpit,项目名称:goh,代码行数:17,代码来源:hclient.go


示例16: GetRegionInfo

/**
 * Get the regininfo for the specified row. It scans
 * the metatable to find region's start and end keys.
 *
 * @return value for specified row/column
 *
 * Parameters:
 *  - Row: row key
 */
func (client *HClient) GetRegionInfo(row string) (region *TRegionInfo, err error) {
	ret, io, e1 := client.hbase.GetRegionInfo(Hbase.Text(row))
	if err = checkHbaseError(io, e1); err != nil {
		return
	}

	region = toRegion(ret)
	return
}
开发者ID:mohanarpit,项目名称:goh,代码行数:18,代码来源:hclient.go


示例17: ScannerOpenWithScan

/**
 * Get a scanner on the current table, using the Scan instance
 * for the scan parameters.
 *
 * Parameters:
 *  - TableName: name of table
 *  - Scan: Scan instance
 *  - Attributes: Scan attributes
 */
func (client *HClient) ScannerOpenWithScan(tableName string, scan *TScan, attributes map[string]string) (id int32, err error) {
	ret, io, e1 := client.hbase.ScannerOpenWithScan(Hbase.Text(tableName), toHbaseTScan(scan), toHbaseTextMap(attributes))
	if err = checkHbaseError(io, e1); err != nil {
		return
	}

	id = int32(ret)
	return
}
开发者ID:mohanarpit,项目名称:goh,代码行数:18,代码来源:hclient.go


示例18: toHbaseTextListFromByte

func toHbaseTextListFromByte(list [][]byte) []Hbase.Text {
	if list == nil {
		return nil
	}

	l := len(list)
	data := make([]Hbase.Text, l)
	for i := 0; i < l; i++ {
		data[i] = Hbase.Text(list[i])
	}
	return data
}
开发者ID:mohanarpit,项目名称:goh,代码行数:12,代码来源:htype.go


示例19: toHbaseTextMap

func toHbaseTextMap(source map[string]string) map[string]Hbase.Text {
	if source == nil {
		return nil
	}

	data := make(map[string]Hbase.Text, len(source))
	for k, v := range source {
		data[k] = Hbase.Text(v)
	}

	return data
}
开发者ID:mohanarpit,项目名称:goh,代码行数:12,代码来源:htype.go


示例20: GetRowsWithColumns

/**
 * Get the specified columns for the specified table and rows at the latest
 * timestamp. Returns an empty list if no rows exist.
 *
 * @return TRowResult containing the rows and map of columns to TCells
 *
 * Parameters:
 *  - TableName: name of table
 *  - Rows: row keys
 *  - Columns: List of columns to return, null for all columns
 *  - Attributes: Get attributes
 */
func (client *HClient) GetRowsWithColumns(tableName string, rows [][]byte, columns []string, attributes map[string]string) (data []*Hbase.TRowResult, err error) {
	if err = client.Open(); err != nil {
		return
	}

	ret, io, e1 := client.hbase.GetRowsWithColumns(Hbase.Text(tableName), toHbaseTextListFromByte(rows), toHbaseTextList(columns), toHbaseTextMap(attributes))
	if err = checkHbaseError(io, e1); err != nil {
		return
	}

	data = ret
	return
}
开发者ID:mohanarpit,项目名称:goh,代码行数:25,代码来源:hclient.go



注:本文中的github.com/sdming/goh/Hbase.Text函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang gotype.Compare函数代码示例发布时间:2022-05-28
下一篇:
Golang rack.New函数代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap