Interface ClientIgniteSet<T>

    • Method Detail

      • add

        boolean add​(T o)
        Specified by:
        add in interface Collection<T>
        Specified by:
        add in interface Set<T>
      • iterator

        ClientAutoCloseableIterator<T> iterator()
        Returns an iterator over the elements in this collection.

        There are no guarantees concerning the order in which the elements are returned.

        Returned iterator is AutoCloseable: it may hold server-side resources and must be closed. It will close itself when the last page of data (see pageSize()) is fetched from the server. When Iterator.hasNext() returns false, it is guaranteed that the iterator is closed. In other cases (incomplete iteration) the user must close the iterator.

        Specified by:
        iterator in interface Collection<T>
        Specified by:
        iterator in interface Iterable<T>
        Specified by:
        iterator in interface Set<T>
        Returns:
        an Iterator over the elements in this collection.
      • name

        String name()
        Gets set name.
        Returns:
        Set name.
      • colocated

        boolean colocated()
        Gets a value indicating whether all items of this set are stored on a single node.
        Returns:
        True if all items of this set are stored on a single node, false otherwise.
      • removed

        boolean removed()
        Gets a value indicating whether this set has been removed (close() was called).
        Returns:
        True if set was removed from cache, false otherwise.
      • serverKeepBinary

        ClientIgniteSet<T> serverKeepBinary​(boolean keepBinary)
        Sets a value indicating whether user objects should be kept in binary form on the server, or deserialized.

        Default is true: does not require classes on server, interoperable with other thin clients, performs better. Suitable for most use cases.

        Set to false if there is a requirement to use deserialized objects in "thick" API (IgniteSet) together with thin client API, like in this scenario:

         
          ClientIgniteSet<UserObj> clientSet = client.set("my-set", new ClientCollectionConfiguration());
          clientSet.serverKeepBinary(false);
        
          IgniteSet<UserObj> serverSet = server.set(clientSet.name(), null);
        
          clientSet.add(new UserObj(1, "client"));
          assert serverSet.contains(new UserObj(1, "client"));
         
        Parameters:
        keepBinary - Whether to keep objects in binary form on the server.
        Returns:
        This set instance (for chaining).
      • serverKeepBinary

        boolean serverKeepBinary()
        Gets a value indicating whether user objects should be kept in binary form on the server, or deserialized.

        Default is true: does not require classes on server, interoperable with other thin clients, performs better. Suitable for most use cases.

        Set to false if there is a requirement to use deserialized objects in "thick" API (IgniteSet) together with thin client API, like in this scenario:

         
          ClientIgniteSet<UserObj> clientSet = client.set("my-set", new ClientCollectionConfiguration());
          clientSet.serverKeepBinary(false);
        
          IgniteSet<UserObj> serverSet = server.set(clientSet.name(), null);
        
          clientSet.add(new UserObj(1, "client"));
          assert serverSet.contains(new UserObj(1, "client"));
         
        Returns:
        true when user objects will be kept in binary form on the server, false otherwise.
      • pageSize

        ClientIgniteSet<T> pageSize​(int pageSize)
        Sets the page size to be used for batched network data retrieval in iterator() and toArray().
        Parameters:
        pageSize - Page size.
        Returns:
        This set instance (for chaining).
      • pageSize

        int pageSize()
        Gets the page size to be used for batched network data retrieval in iterator() and toArray().
        Returns:
        Page size.