Serialization table key
@param {number} serviceId
@param {number} tableIndex
@returns {Array}
557418
function serializeKey (serviceId, tableIndex) {
  let buffer = []
  Uint16.serialize(serviceId, buffer, buffer.length)
  Uint16.serialize(tableIndex, buffer, buffer.length)
  return buffer
}
880338
private Object[] findIdsByColumn(String tableName, String columnName, Object columnValue)
    {
        Object connection = null;

        try
        {
            connection = getConnection();
            String valueAsStr = PropertyAccessorHelper.getString(columnValue);

            Set<String> results = null;

            if (resource != null && resource.isActive())
            {
                Response response = ((Transaction) connection).zrangeByScore(getHashKey(tableName, columnName),
                        getDouble(valueAsStr), getDouble(valueAsStr));
                // ((Transaction) connection).exec();
                ((RedisTransaction) resource).onExecute(((Transaction) connection));

                results = (Set<String>) response.get();
            }
            else
            {
                results = ((Jedis) connection).zrangeByScore(getHashKey(tableName, columnName), getDouble(valueAsStr),
                        getDouble(valueAsStr));

            }
            if (results != null)
            {
                return results.toArray(new Object[0]);
            }

        }
        finally
        {
            onCleanup(connection);
        }

        return null;
    }
364177
function MobileServiceSyncTable(tableName, client) {
    Validate.isString(tableName, 'tableName');
    Validate.notNullOrEmpty(tableName, 'tableName');

    Validate.notNull(client, 'client');

    /**
     * Gets the name of the local table.
     * 
     * @returns {string} The name of the table.
     */
    this.getTableName = function () {
        return tableName;
    };

    /**
     * Gets the {@link MobileServiceClient} instance associated with this table.
     * 
     * @returns {MobileServiceClient} The {@link MobileServiceClient} associated with this table.
     */
    this.getMobileServiceClient = function () {
        return client;
    };

    /**
     * Inserts a new object / record in the local table.
     * If the inserted object does not specify an id, a GUID will be used as the id.
     * 
     * @param {object} instance Object / record to be inserted in the local table.
     * @param {string} instance.id The id of the record. If this is null / undefined, a GUID string
     *                             will be used as the id.
     * @returns {Promise} A promise that is resolved with the inserted object when the insert operation is completed successfully.
     *                    If the operation fails, the promise is rejected with the error.
     */
    this.insert = function (instance) {
        return client.getSyncContext().insert(tableName, instance);
    };

    /**
     * Update an object / record in the local table.
     * 
     * @param {object} instance New value of the object / record.
     * @param {string} instance.id The id of the object / record identifies the record that will be updated in the table.
     * 
     * @returns {Promise} A promise that is resolved when the operation is completed successfully.
     *                    If the operation fails, the promise is rejected with the error.
     */
    this.update = function (instance) {
        return client.getSyncContext().update(tableName, instance);
    };

    /**
     * Looks up an object / record from the local table using the object id.
     * 
     * @param {string} id id of the object to be looked up in the local table.
     * @param {boolean} [suppressRecordNotFoundError] If set to true, lookup will return an undefined object
     *                                                if the record is not found. Otherwise, lookup will fail.
     *                                                This flag is useful to distinguish between a lookup
     *                                                failure due to the record not being present in the table
     *                                                versus a genuine failure in performing the lookup operation.
     * 
     * @returns {Promise} A promise that is resolved with the looked up object when the lookup is completed successfully.
     *                    If the operation fails, the promise is rejected with the error.
     */
    this.lookup = function (id, suppressRecordNotFoundError) {
        return client.getSyncContext().lookup(tableName, id, suppressRecordNotFoundError);
    };

    /**
     * Reads records from the local table.
     * 
     * @param {QueryJs} query A {@link QueryJs} object representing the query to use while
     *                        reading the local table
     * @returns {Promise} A promise that is resolved with an array of records read from the table, if the read is successful.
     *                    If read fails, the promise is rejected with the error.
     */
    this.read = function (query) {
        if (_.isNull(query)) {
            query = new Query(tableName);
        }
        
        return client.getSyncContext().read(query);
    };

    /**
     * Deletes an object / record from the local table.
     * 
     * @param {object} instance The object to delete from the local table. 
     * @param {string} instance.id id of the record to be deleted.
     * 
     * @returns {Promise} A promise that is resolved when the delete operation completes successfully.
     *                    If the operation fails, the promise is rejected with the error.
     */
    this.del = function (instance) {
        return client.getSyncContext().del(tableName, instance);
    };

    /**
     * Pulls changes from server table into the local table.
     * 
     * @param {QueryJs} query Query specifying which records to pull.
     * @param {string} queryId A unique string id for an incremental pull query. A null / undefined queryId 
     *                         will perform a vanilla pull, i.e. will pull all the records specified by the table
     *                         from the server 
     * @param {MobileServiceSyncContext.PullSettings} [settings] An object that defines various pull settings. 
     * 
     * @returns {Promise} A promise that is fulfilled when all records are pulled OR is rejected  with the error if pull fails.  
     */
    this.pull = function (query, queryId, settings) {
        if (!query) {
            query = new Query(tableName);
        }
        
        return client.getSyncContext().pull(query, queryId, settings);
    };

    /**
     * Purges data from the local table as well as pending operations and any incremental sync state 
     * associated with the table.
     * 
     * A _regular purge_, would fail if there are any pending operations for the table being purged.
     * 
     * A _forced purge_ will proceed even if pending operations for the table being purged exist in the operation table. In addition,
     * it will also delete the table's pending operations.
     * 
     * @param {QueryJs} query A {@link QueryJs} object representing the query that specifies what records are to be purged.
     * @param {boolean} forcePurge If set to true, the method will perform a forced purge.
     * 
     * @returns {Promise} A promise that is fulfilled when purge is complete OR is rejected with the error if it fails.  
     */
    this.purge = function (query, forcePurge) {
        if (!query) {
            query = new Query(tableName);
        }

        return client.getSyncContext().purge(query, forcePurge);
    };
}
871056
public OvhOperation serviceName_output_elasticsearch_alias_aliasId_index_POST(String serviceName, String aliasId, String indexId) throws IOException {
		String qPath = "/dbaas/logs/{serviceName}/output/elasticsearch/alias/{aliasId}/index";
		StringBuilder sb = path(qPath, serviceName, aliasId);
		HashMap<String, Object>o = new HashMap<String, Object>();
		addBody(o, "indexId", indexId);
		String resp = exec(qPath, "POST", sb.toString(), o);
		return convertTo(resp, OvhOperation.class);
	}
852654
private static void serializeRow(SSTableIdentityIterator row, DecoratedKey key, PrintStream out)
    {
        serializeRow(row.getColumnFamily().deletionInfo(), row, row.getColumnFamily().metadata(), key, out);
    }
958597
function(indexOrItem) {
          var list = this.$list;
          if( angular.isNumber(indexOrItem) && indexOrItem >= 0 && list.length >= indexOrItem ) {
            return list[indexOrItem];
          }
          else if( angular.isObject(indexOrItem) ) {
            // it must be an item in this array; it's not sufficient for it just to have
            // a $id or even a $id that is in the array, it must be an actual record
            // the fastest way to determine this is to use $getRecord (to avoid iterating all recs)
            // and compare the two
            var key = this.$$getKey(indexOrItem);
            var rec = this.$getRecord(key);
            return rec === indexOrItem? rec : null;
          }
          return null;
        }
1211314
func servicesTableSchema() *memdb.TableSchema {
	return &memdb.TableSchema{
		Name: "services",
		Indexes: map[string]*memdb.IndexSchema{
			"id": &memdb.IndexSchema{
				Name:         "id",
				AllowMissing: false,
				Unique:       true,
				Indexer: &memdb.CompoundIndex{
					Indexes: []memdb.Indexer{
						&memdb.StringFieldIndex{
							Field:     "Node",
							Lowercase: true,
						},
						&memdb.StringFieldIndex{
							Field:     "ServiceID",
							Lowercase: true,
						},
					},
				},
			},
			"node": &memdb.IndexSchema{
				Name:         "node",
				AllowMissing: false,
				Unique:       false,
				Indexer: &memdb.StringFieldIndex{
					Field:     "Node",
					Lowercase: true,
				},
			},
			"service": &memdb.IndexSchema{
				Name:         "service",
				AllowMissing: true,
				Unique:       false,
				Indexer: &memdb.StringFieldIndex{
					Field:     "ServiceName",
					Lowercase: true,
				},
			},
			"connect": &memdb.IndexSchema{
				Name:         "connect",
				AllowMissing: true,
				Unique:       false,
				Indexer:      &IndexConnectService{},
			},
		},
	}
}
294981
public Map getInfoByIdService(Map requestParamMap,String tableName){
		String tempKeyId=calcuIdKey();
		String id=(String) requestParamMap.get(tempKeyId);
		//add 20170831 ninghao
		Map filterViewRet=filterView4Select(tableName,requestParamMap,id,tempKeyId,TYPE_SELECT_ID);
		if(filterViewRet!=null ){
			return filterViewRet;
		}
		
		Map retMap=getInnerDao().queryObjJoinByBizId(tableName, id, tempKeyId);
		if(retMap==null){
			return null;
		}
		CheckModelTypeUtil.addMetaCols(retMap);
		CheckModelTypeUtil.changeNoStrCols(retMap);
		return retMap;
	}
292900
function getIndex(index) {
        if (this[_privateKey]._options.keysIgnoreCase && typeof index === 'string') {
            const indexLowerCase = index.toLowerCase();
            for (const key in this[_privateKey]._schema) {
                if (typeof key === 'string' && key.toLowerCase() === indexLowerCase) {
                    return key;
                }
            }
        }

        return index;
    }
919041
function serializeQuery(paramsObj) {
    var k, params = [];
    for (k in paramsObj) {
      if (paramsObj.hasOwnProperty(k) && paramsObj[k] !== undefined) {
        params.push(encodeURIComponent(k) + "=" + encodeURIComponent(paramsObj[k]));
      }
    }
    return params.join("&");
  }
1140146
function mappingToTable(mapping) {
  const mp = mapping.hasOwnProperty('field') ? singleToMulti(mapping) : mapping;
  const keyField = {key: mp.key, format: 'text'};
  const data = {
    fields: [keyField].concat(mp.fields),
    records: Object.entries(mp.mapping).map(entry => {
      const rcd = {};
      rcd[mp.key] = entry[0];
      mp.fields.forEach((f, i) => {
        rcd[f.key] = entry[1][i];
      });
      return rcd;
    })
  };
  return data;
}
1000540
function getIndexOfColumn(tableStructure, column) {
  for (var i = 0; i < tableStructure.columns.length; i++) {
    if (tableStructure.columns[i] === column) {
      return i;
    }
  }
}
1253244
function(index, columnName) {
      var r = this.at(index);
      if(!r) {
        return null;
      }
      return r.get(columnName);
    }
1315631
private Map<String, ServiceEndPoint> indexById(Iterable<ServiceEndPoint> endPoints) {
        Map<String, ServiceEndPoint> map = Maps.newHashMap();
        for (ServiceEndPoint endPoint : endPoints) {
            map.put(endPoint.getId(), endPoint);
        }
        return map;
    }
736571
private ColumnInfo getColumn(TableInfo tableInfo, Attribute column, PropertyIndex indexedColumn,
            String[] orderByColumns)
    {
        ColumnInfo columnInfo = new ColumnInfo();

        if (column.getJavaType().isAnnotationPresent(OrderBy.class))
        {
            OrderBy order = (OrderBy) column.getJavaType().getAnnotation(OrderBy.class);
            orderByColumns = order.value().split("\\s*,\\s*");

        }
        columnInfo.setOrderBy(getOrderByColumn(orderByColumns, column));

        if (column.getJavaType().isEnum())
        {
            columnInfo.setType(String.class);
        }
        else
        {
            columnInfo.setType(column.getJavaType());
        }
        columnInfo.setColumnName(((AbstractAttribute) column).getJPAColumnName());
        if (indexedColumn != null && indexedColumn.getName() != null)
        {
            columnInfo.setIndexable(true);
            IndexInfo indexInfo = new IndexInfo(((AbstractAttribute) column).getJPAColumnName(), indexedColumn.getMax(),
                    indexedColumn.getMin(), indexedColumn.getIndexType(), indexedColumn.getName());
            tableInfo.addToIndexedColumnList(indexInfo);
            // Add more if required
        }

        return columnInfo;
    }
1341227
function serialize(obj, opts, prefix) {
  var str = []
    , useArraySyntax = false

  // if there's a prefix, and this object is an array, use array syntax
  // i.e., `prefix[]=foo&prefix[]=bar` instead of `prefix[0]=foo&prefix[1]=bar`
  if (Array.isArray(obj) && prefix) {
    useArraySyntax = true
  }

  Object.keys(obj).forEach(function (prop) {
    var key, query, val = obj[prop]

    key = prefix ?
      prefix + '[' + (useArraySyntax ? '' : prop) + ']' :
      prop

    if (val === null) {
      if (opts.removeNull) {
        return
      }
      query = opts.encodeComponents ? encodeURIComponent(key) : key
    } else if (typeof val === 'object') {
      query = serialize(val, opts, key)
    } else {
      query = opts.encodeComponents ?
        encodeURIComponent(key) + '=' + encodeURIComponent(val) :
        key + '=' + val;
    }
    str.push(query)
  })

  return str.join('&')
}
572757
@Override
    public <E> List<E> getColumnsById(String schemaName, String joinTableName, String joinColumnName,
            String inverseJoinColumnName, Object parentId, Class columnJavaType)
    {
        List<Object> foreignKeys = new ArrayList<Object>();

        if (getCqlVersion().equalsIgnoreCase(CassandraConstants.CQL_VERSION_3_0))
        {
            foreignKeys = getColumnsByIdUsingCql(schemaName, joinTableName, joinColumnName, inverseJoinColumnName,
                    parentId, columnJavaType);
        }
        else
        {
            Selector selector = clientFactory.getSelector(pool);

            List<Column> columns = selector.getColumnsFromRow(joinTableName,
                    Bytes.fromByteArray(PropertyAccessorHelper.getBytes(parentId)),
                    Selector.newColumnsPredicateAll(true, 10), getConsistencyLevel());

            foreignKeys = dataHandler.getForeignKeysFromJoinTable(inverseJoinColumnName, columns, columnJavaType);

            if (log.isInfoEnabled())
            {
                log.info("Returning number of keys from join table", foreignKeys != null ? foreignKeys.size() : null);
            }
        }
        return (List<E>) foreignKeys;
    }