public interface Browser extends java.lang.Iterable<Tuple>, java.lang.AutoCloseable
EventBrowser
which is used to iterate over events associated with the entries in a Space (e.g. put, take, expire).
A Browser is created by calling Metaspace.browse(java.lang.String, com.tibco.as.space.browser.BrowserDef.BrowserType).
All Browsers implement a next() and a stop() method but unlike traditional iterators, a
Browser does not have a hasNext() method. Instead Browsers have a timeout which is the
amount of time that the next() method call will block while waiting for a new entry
to be added to the Space.
There are different types of Browsers. What the next() method does depends upon the type
of the Browser:
GET Browser's next() method gets the next entry in the space and returns it.
TAKE Browser's next() method takes the next entry from the space and returns it.
LOCK Browser's next() method locks the next entry in the space and returns it.
TAKE and LOCK Browsers are always consistent with the Space. For example,
if two separate TAKE Browsers are browsing the same Space (regardless of their location),
they will NEVER be able to take the same entry. Browsers are continuously updated (coherent) with the
real-time changes occurring in the Space being browsed (unless the Browser's time scope is SNAPSHOT).
Browsers have several mechanisms which help to limit the entries being browsed.
The time scope setting limits the set of entries being iterated over based upon the time the Browser is created.
BrowserDef,
EventBrowser| Modifier and Type | Method and Description |
|---|---|
java.util.Map<Member,java.lang.String> |
getQueryLogs()
Deprecated.
|
BrowserDef.BrowserType |
getType()
Retrieve the type of the Browser.
|
boolean |
isPartialResult()
Indicates whether the results are incomplete due to query limit.
|
Tuple |
next()
Retrieve the next entry from the Space.
|
void |
query(java.lang.String filter) |
void |
reset() |
long |
size()
actual size of the browser if SNAPSHOT and prefetch_all is used
otherwise estimated size of tuples to be returned from the browser
|
void |
stop()
Stop the Browser.
|
void query(java.lang.String filter)
throws ASException
filter - ASExceptionvoid reset()
throws ASException
ASExceptionTuple next() throws ASException
ASException - An exception is thrown if an error occurs while retrieving the values of the entry.void stop() throws ASException
ASException - An exception is thrown if an error occurs while trying to stop the Browser.BrowserDef.BrowserType getType()
@Deprecated java.util.Map<Member,java.lang.String> getQueryLogs()
boolean isPartialResult()
long size()
Copyright (c) 2014 Cloud Software Group, Inc. All rights reserved.