Find the current highest bid id in the bids table.  We'll start generating
new bids at this number plus one.
@param client    A connection to the database
@return current highest bid id
778968
private static long getMaxBidId(Client client) {
        long currentMaxBidId = 0;
        try {
            VoltTable vt = client.callProcedure("@AdHoc", "select max(id) from bids").getResults()[0];
            vt.advanceRow();
            currentMaxBidId = vt.getLong(0);
            if (vt.wasNull()) {
                currentMaxBidId = 0;
            }
        } catch (IOException | ProcCallException e) {
            e.printStackTrace();
        }

        return currentMaxBidId;
    }
832711
protected int fetchLastInsertedId (Connection conn, String table, String column)
        throws SQLException
    {
        throw new SQLException(
            "Unable to obtain last inserted id [table=" + table + ", column=" + column + "]");
    }
314557
def _GetClientIdFromQueue(q):
  
  split = q.Split()
  if not split or len(split) < 2:
    return None

  # Normalize to lowercase.
  split = [s.lower() for s in split]

  str_client_id, tasks_marker = split

  if not str_client_id.startswith("c.") or tasks_marker != "tasks":
    return None

  # The "C." prefix should be uppercase.
  str_client_id = "C" + str_client_id[1:]

  return str_client_id
1238230
public boolean next() throws OdaException
	{
        int maxRows = getMaxRows();
        if( m_currentRowId < maxRows )
        {
            m_currentRowId++;
            currentRow = sqlResult.get(m_currentRowId-1);
            return true;
        }
        
        return false;        
	}
268955
public com.google.api.ads.adwords.axis.v201809.mcm.ManagedCustomer getClient() {
        return client;
    }
561022
def get_client(self, client_id):
        ''''''
        client_response = self.get_request('clients/%s' % client_id)
        return Client(self, client_response['client'])
545992
protected void fixClientID() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "fixClientID");

        synchronized (stateLock) {
            clientIDFixed = true;
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "fixClientID");
    }
662855
function QueryBuilder(client) {
  this.client = client;
  this.and = this;
  this._single = {};
  this._statements = [];

  // Internal flags used in the builder.
  this._method = 'select';
  this._joinFlag = 'inner';
  this._boolFlag = 'and';
  this._notFlag = false;
}
172450
public static long getClientCustomerId(AdWordsSession session) {
    String accountIdStr = session.getClientCustomerId();

    // clientCustomerId might be absent from AdWordsSession, e.g., for
    // ReportDefinitionService.getReportFields() and CustomerService.getCustomers().
    // In this case, use ONE virtual account to handle rate limit of ALL unknown accounts combined.
    if (accountIdStr == null) {
      return VIRTUAL_CID;
    }

    try {
      return Long.parseLong(accountIdStr.replace("-", ""));
    } catch (NumberFormatException e) {
      throw new RateLimiterException("Encountered invalid CID: " + accountIdStr, e);
    }
  }
106602
private long findHighestId() {
        return this.registeredServices.stream().map(RegisteredService::getId).max(Comparator.naturalOrder()).orElse(0L);
    }
847268
public int getMaxIdx() {
        int max = Integer.MIN_VALUE;
        for (int i=0; i<this.top; i++) {
            if (idx[i] > max) {
                max = idx[i];
            }
        }
        return max;
    }
717561
def CreateBiddingStrategy(client):
  
  # Initialize appropriate service.
  bidding_strategy_service = client.GetService(
      'BiddingStrategyService', version='v201809')

  # Create a shared bidding strategy.
  shared_bidding_strategy = {
      'name': 'Maximize Clicks %s' % uuid.uuid4(),
      'biddingScheme': {
          'xsi_type': 'TargetSpendBiddingScheme',
          # Optionally set additional bidding scheme parameters.
          'bidCeiling': {
              'microAmount': '2000000'
          }
      }
  }

  # Create operation.
  operation = {
      'operator': 'ADD',
      'operand': shared_bidding_strategy
  }

  response = bidding_strategy_service.mutate([operation])
  new_bidding_strategy = response['value'][0]

  print ('Shared bidding strategy with name "%s" and ID "%s" of type "%s"'
         'was created.' %
         (new_bidding_strategy['name'], new_bidding_strategy['id'],
          new_bidding_strategy['biddingScheme']['BiddingScheme.Type']))

  return new_bidding_strategy
953661
@Override
    public Object generate(Client<?> client, String dataType)
    {

        final String generatedId = "Select now() from system_schema.columns";
        ResultSet rSet = ((DSClient) client).execute(generatedId, null);

        UUID uuid = rSet.iterator().next().getUUID(0);
        return uuid;
    }
359085
public com.google.api.ads.adwords.axis.v201809.cm.Money getMaxCpcBidFloor() {
        return maxCpcBidFloor;
    }
10652
public Client build(final Client client) {
    client.register(TracingClientFilter.create(tracing));
    return client;
  }
681761
private static String getKunderaClientToLookupClass(String client)
    {

        Datasource datasource;
        try
        {
            datasource = Datasource.valueOf(client.toUpperCase());
        }
        catch (IllegalArgumentException ex)
        {
            LOGGER.error(client + " is not supported!", ex);
            throw new KunderaException(client + " is not supported!", ex);
        }

        return clientNameToFactoryMap.get(datasource);
    }
84025
public void clientSessionDidEnd (PresentsSession client)
    {
        if (ignoreClient(client)) {
            return;
        }

        // we scan through the list instead of relying on ClientInfo.getKey() because we want
        // derived classes to be able to override that for lookups that happen way more frequently
        // than logging off
        Name username = client.getAuthName();
        for (ClientInfo clinfo : _nodeobj.clients) {
            if (clinfo.username.equals(username)) {
                _nodeobj.startTransaction();
                try {
                    // we clear our client info in a transaction so that derived classes can remove
                    // other things from the NodeObject and we'll send that out to all of our peers
                    // in a single compound event
                    clearClientInfo(client, clinfo);
                } finally {
                    _nodeobj.commitTransaction();
                }
                return;
            }
        }
        log.warning("Session ended for unregistered client", "who", username);
    }