Mbeans for FETCH_ENTRIES
540505
@JmxGetter(name = "avgFetchEntriesNetworkTimeMs", description = "average time spent on network, for streaming operations")
    public double getAvgFetchEntriesNetworkTimeMs() {
        return networkTimeCounterMap.get(Operation.FETCH_ENTRIES).getAvgEventValue()
               / Time.NS_PER_MS;
    }
680583
def fetchmany(self, size=None):
        """"""
        self._check_executed()
        if self._rows is None:
            return ()
        end = self.rownumber + (size or self.arraysize)
        result = self._rows[self.rownumber:end]
        self.rownumber = min(end, len(self._rows))
        return result
413439
@SuppressWarnings("unused") // called through reflection by RequestServer
  public ModelsV3 fetch(int version, ModelsV3 s) {
    Model model = getFromDKV("key", s.model_id.key());
    s.models = new ModelSchemaV3[1];
    s.models[0] = (ModelSchemaV3)SchemaServer.schema(version, model).fillFromImpl(model);

    if (s.find_compatible_frames) {
      // TODO: refactor fetchFrameCols so we don't need this Models object
      Models m = new Models();
      m.models = new Model[1];
      m.models[0] = model;
      m.find_compatible_frames = true;
      Frame[] compatible = Models.findCompatibleFrames(model, Frame.fetchAll(), m.fetchFrameCols());
      s.compatible_frames = new FrameV3[compatible.length]; // TODO: FrameBaseV3
      ((ModelSchemaV3)s.models[0]).compatible_frames = new String[compatible.length];
      int i = 0;
      for (Frame f : compatible) {
        s.compatible_frames[i] = new FrameV3(f);
        ((ModelSchemaV3)s.models[0]).compatible_frames[i] = f._key.toString();
        i++;
      }
    }

    return s;
  }
283566
static List<User> onQueryByEmail(final EntityManager em, final User user) 
    {
		// Query by parameter (fetch user by email id)
		String query = "Select u from User u where u.emailId =?1";

		logger.info("");
		logger.info("");
		logger.info(query);
		System.out.println("#######################Querying##########################################");

		// find by named parameter(e.g. email)
		List<User> fetchedUsers = findByEmail(em, query, user.getEmailId());
		return fetchedUsers;
	}
1321398
def fetch(*keys, default: nil, &block)
      # check alias
      real_key = @aliases[flatten_keys(keys)]
      keys = real_key.split(key_delim) if real_key

      keys = convert_to_keys(keys)
      env_key = autoload_env? ? to_env_key(keys[0]) : @envs[flatten_keys(keys)]
      # first try settings
      value = deep_fetch(@settings, *keys)
      # then try ENV var
      if value.nil? && env_key
        value = ENV[env_key]
      end
      # then try default
      value = block || default if value.nil?

      while callable_without_params?(value)
        value = value.call
      end
      value
    end
312838
final List<? extends E> get(String hostname) {
        Entries entries = resolveCache.get(hostname);
        return entries == null ? null : entries.get();
    }
589173
def _fetch_objects(self, key, value):
        """"""
        return self.to_cls.query.filter(**{key: value})
334466
LogData fetchLogs(final int execId, final String name, final int attempt,
      final int startByte,
      final int length) throws ExecutorManagerException {
    final FetchLogsHandler handler = new FetchLogsHandler(startByte, length + startByte);
    try {
      return this.dbOperator.query(FetchLogsHandler.FETCH_LOGS, handler,
          execId, name, attempt, startByte, startByte + length);
    } catch (final SQLException e) {
      throw new ExecutorManagerException("Error fetching logs " + execId
          + " : " + name, e);
    }
  }
1244456
def fetchcbatch(self):
        ''''''
        if not self._last_operation.is_columnar:
            raise NotSupportedError("Server does not support columnar "
                                    "fetching")
        if not self.has_result_set:
            raise ProgrammingError(
                "Trying to fetch results on an operation with no results.")
        if len(self._buffer) > 0:
            log.debug('fetchcbatch: buffer has data in. Returning it and wiping buffer')
            batch = self._buffer
            self._buffer = Batch()
            return batch
        elif self._last_operation_active:
            log.debug('fetchcbatch: buffer empty and op is active => fetching '
                      'more data')
            batch = (self._last_operation.fetch(
                         self.description,
                         self.buffersize,
                         convert_types=self.convert_types))
            if len(batch) == 0:
               return None
            return batch
        else:
           return None
694959
def get_active_entry(user, select_for_update=False):
    """"""
    entries = apps.get_model('entries', 'Entry').no_join
    if select_for_update:
        entries = entries.select_for_update()
    entries = entries.filter(user=user, end_time__isnull=True)

    if not entries.exists():
        return None
    if entries.count() > 1:
        raise ActiveEntryError('Only one active entry is allowed.')
    return entries[0]
793302
def parse(cls, requester, entries):
        """"""
        result_entries = SearchableList()
        for entry in entries:
            result_entries.append(cls.instance.parse(requester, entry))
        return result_entries
1002552
private List<String> getAllAttributesNames(MBeanServerExecutor pServerManager, ObjectName pObjectName)
            throws IOException, ReflectionException, MBeanException, AttributeNotFoundException, InstanceNotFoundException {
        MBeanInfo mBeanInfo = getMBeanInfo(pServerManager, pObjectName);
        List<String> ret = new ArrayList<String>();
        for (MBeanAttributeInfo attrInfo : mBeanInfo.getAttributes()) {
            if (attrInfo.isReadable()) {
                ret.add(attrInfo.getName());
            }
        }
        return ret;
    }
1084896
@Override
    public List<?> getResultList()
    {
        if (log.isDebugEnabled())
            log.info("On getResultList() executing query: " + getJPAQuery());

        // as per JPA post event should happen before fetching data from
        // database.
        List results = null;

        if (getEntityMetadata() == null)
        {
            // Scalar Query
            if (kunderaQuery.isDeleteUpdate())
            {
                executeUpdate();
            }
            else
            {
                Client client = persistenceDelegeator.getClient(kunderaQuery.getPersistenceUnit());
                results = populateEntities(null, client);
            }
        }
        else
        {
            handlePostEvent();

            if (kunderaQuery.isDeleteUpdate())
            {
                executeUpdate();
            }
            else
            {
                results = fetch();
                assignReferenceToProxy(results);
            }
        }
        return results != null ? results : new ArrayList();
    }
1084492
private static String getJmxResult(MBeanServerConnection connetion, String url) throws Exception {
        ObjectName name = new ObjectName(DruidStatService.MBEAN_NAME);

        return (String) conn.invoke(name, "service", new String[]{url},
                new String[]{String.class.getName()});
    }
1199569
protected Query[] buildPrefetchQueries(Collection owners, Collection children)
    {
        ClassDescriptor cld = getOwnerClassDescriptor();
        Class topLevelClass = getBroker().getTopLevelClass(cld.getClassOfObject());
        BrokerHelper helper = getBroker().serviceBrokerHelper();
        Collection queries = new ArrayList(owners.size());
        Collection idsSubset = new HashSet(owners.size());
        Object[] fkValues;
        Object owner;
        Identity id;

        Iterator iter = owners.iterator();
        while (iter.hasNext())
        {
            owner = iter.next();
            fkValues = helper.extractValueArray(helper.getKeyValues(cld, owner));
            id = getBroker().serviceIdentity().buildIdentity(null, topLevelClass, fkValues);
            idsSubset.add(id);
            if (idsSubset.size() == pkLimit)
            {
                queries.add(buildPrefetchQuery(idsSubset));
                idsSubset.clear();
            }
        }

        if (idsSubset.size() > 0)
        {
            queries.add(buildPrefetchQuery(idsSubset));
        }

        return (Query[]) queries.toArray(new Query[queries.size()]);
    }
888399
public HBeanRowCollector listEager(String schemaName, FetchType... fetchType)
            throws HBeanNotFoundException {
        Set<HBeanRow> rows = listLazy(schemaName, fetchType);
        HBeanRowCollector collector = new HBeanRowCollector(rows);
        getEager(rows, collector, FETCH_DEPTH_MAX, fetchType);
        return collector;
    }
224529
def find_entries(self, users, start, *args, **kwargs):
        
        forever = kwargs.get('all', False)
        for user in users:
            if forever:
                entries = Entry.objects.filter(user=user).order_by('start_time')
            else:
                entries = Entry.objects.filter(
                    user=user, start_time__gte=start).order_by(
                    'start_time')
            yield entries