Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question

oravecz's profile - activity

2021-06-11 07:10:53 -0500 received badge  Famous Question (source)
2021-06-11 07:10:53 -0500 received badge  Notable Question (source)
2021-06-11 07:10:53 -0500 received badge  Popular Question (source)
2017-11-17 04:14:46 -0500 received badge  Notable Question (source)
2017-11-17 04:14:46 -0500 received badge  Popular Question (source)
2017-09-27 04:30:11 -0500 received badge  Student (source)
2017-09-27 04:29:26 -0500 received badge  Notable Question (source)
2017-05-21 20:38:05 -0500 received badge  Notable Question (source)
2017-05-21 20:38:05 -0500 received badge  Famous Question (source)
2017-05-21 20:38:05 -0500 received badge  Popular Question (source)
2015-11-06 10:20:48 -0500 received badge  Popular Question (source)
2015-03-14 14:58:47 -0500 received badge  Popular Question (source)
2013-08-08 09:39:35 -0500 marked best answer Associating templates with listeners in a polling container

The namespace configuration makes it simple to configure gigaspaces using Spring contexts, but I am confused by the following structure...

<os-events:polling-container id="translationContainer" giga-space="space" concurrent-consumers="4"> <os-core:template> <bean class="com.company.app.Task"> <property name="taskWorkflow" value="POST"/> </bean> </os-core:template> <os-events:listener> <os-events:method-adapter method-name="process"> <os-events:delegate ref="validator"/> </os-events:method-adapter> </os-events:listener> </os-events:polling-container>

I can see that the polling container will call the Validator.process method when a Task object in the space has a taskWorkflow property with a value of POST.

Now suppose that the taskWorkflow property can have many different values, and I have a separate listener for each of these states. How would I wire each of these properties to a specific listener?

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=2453]{quote}

2013-08-08 09:39:32 -0500 marked best answer update versus save

In the Extreme Application Platform Tutorial ([ http://www.gigaspaces.com/wiki/displa... ]) there is an AccountDataDAO class that has two methods that seem very similar. I am wondering if someone can explain why these two methods exist and what makes them useful?

I am referring to these two methods: {code:default} /** * Updates the accountData object according to its userName unique * attribute. Blocks until updates. */ public void updateAccountData(AccountData accountData) { // Writes the account data to the space, using Long.MAX_VALUE_VALUE // as the update timeout (which basically means forever). gigaSpace.write(accountData, Lease.FOREVER, Long.MAX_VALUE, UpdateModifiers.UPDATE_ONLY); }

/**
 * Writes the accountData object to the space.
 * 
 * @param accountData - accountData to be written.
 */
public void save(AccountData accountData) {
    gigaSpace.write(accountData);
}

{code}

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=2457]{quote}

2013-08-08 09:39:31 -0500 marked best answer Connecting the Gigaspaces UI to embedded space

Is there a way for me to connect the UI to an embedded space. Here is my config for starting up the space in my pu.xml.

<bean id="space" class="org.openspaces.core.space.UrlSpaceFactoryBean"
p:url="/./translationSpace"/>

<bean id="gigaspace" class="org.openspaces.core.GigaSpaceFactoryBean"
          p:defaultIsolationLevelName="ISOLATION_DEFAULT"
p:space-ref="space"/>

<bean id="sla" class="org.openspaces.pu.sla.SLA"
          p:clusterSchema="partitioned-sync2backup"
          p:maxInstancesPerVM="1"
          p:numberOfBackups="1"
p:numberOfInstances="2"/>

I've tried a few different addresses in the management center like jini:////translationSpace and rmi://localhost:10098/translationSpace

This thread was imported from the previous forum.
For your reference, the original is available here

2013-08-08 09:39:15 -0500 marked best answer Pattern for states that timeout

A task in my system has a complex workflow (many states) and a few of these states are long-lived while waiting for the user to interact. If the user fails to interact within a specific amount of time I want the system to take control and change the state of the task. Is there a recommended way to establish processes/workers that will execute after tasks reach a certain time threshold in a particular state? I can't depend on the client to indicate this threshold has been met.

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=2382]{quote}

2013-08-08 09:39:09 -0500 marked best answer Choosing a partitioning hash

Ultimately, I am looking to the space as a replacement of the database or as an In-Memory Data Grid (IMDG). My particular objects that are in the IMDG are Tasks and Accounts. A Task has a long lifecycle and will be touched by several Accounts along the way. I don't see a clear partitioning scheme rising from my business objects. Should I force one?

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=2391]{quote}

2013-08-08 09:39:09 -0500 marked best answer Partition strategies and embedded spaces

It seems that the selection of a partitioning hash results in a specific number of hash buckets. For example, if I partition based on the last digit of a social security number, I will end up in 10 potential buckets. As an exercise in scalability, I create two spaces and assign 0-4 to one space and 5-9 to the other. Here are a few questions based on this assumption.

  1. What if my two spaces are the result of two PU's being deployed using an embedded space? It seems like partitioning is a separate exercise from the deployment of PUs (to handle load) that re-partitioning would have to occur each time a new PU was deployed.

  2. Assume I do not use an embedded space. Now I can deploy PU's at will without affecting my PU deployments. However, haven't I capped the number of spaces I can run because I have only 10 hash possibilities?

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=2392]{quote}

2013-08-08 09:38:59 -0500 marked best answer Reservation Design Pattern

I need some advice with a space-based design pattern regarding reservations.

Assume a problem domain like ticket sales or airline seat reservations. In each of these scenarios, the user is presented with an opportunity to reserve a particular seat. During the time the user is evaluating their seat options, it is helpful if they, temporarily, have exclusive rights to this seat. Here is a sample flow:

1. User requests a single ticket to the Mayday Parade concert.
2. System shows the details related to seat 4D.
3. System gives the user 2 minutes to decide.
4. Customer either:
   a) Accepts 4D
   b) Rejects 4D
c) Timeout

In this scenario, I want all my seats to be space entries. My only other restriction prevents a very easy approach to the problem; I don't want to use Take. I want to be able to query all my seats for some reporting, regardless as to their current state.

My idea is this:

1. READ one seat that has status of "ACTIVE" (Not worried about "best seat" yet)
2. UPDATE seat to "PENDING" status.
3. WRITE Reservation object to the space with a Lease period of 2 minutes.
4. If the user:
   a) Accepts the seat - Update seat to "RESERVED", TAKE the reservation.
   b) Rejects the seat - Update seat to "ACTIVE", TAKE the reservation.
c) Lease expires on Reservation - Update seat to "ACTIVE"

I hope this is a valid design pattern. I would welcome any insights on its suitability, especially in a replicated space under heavy load.

I would also be interested in other design patterns that could be applied, and any GigaSpaces-specific APIs that might make this easier. (I do hate having to introduce another entry into the space just for notification purposes.)

This thread was imported from the previous forum.
For your reference, the original is available here

2013-08-08 09:37:39 -0500 marked best answer Template-based reads and nested properties

The API that allows for searching the space seems to be very limiting when the object hierarchy begins to grow deeper. Assume an Employee class that has a property name "homeAddress" of type Address. How would you create a tuple that can search for all Employees who live in the 43082 zip code?

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=2526]{quote}

2008-09-06 00:51:58 -0500 commented answer Polling container takes only once

I figured out my problem. I had an int primitive in my Entry class and I was incrementing this value in my listener. Subsequent templates would not match because the int field was non-null. Argh.

2008-09-06 00:27:24 -0500 commented answer Polling container takes only once

The write takes place in step #5 as witnessed by the gui.

I'll try to simplify my code so I can post more, but for now here are the two containers from the pu.xml file:

<bean id="orderSubmitedContainer"
      class="org.openspaces.events.polling.SimplePollingEventListenerContainer"
      p:gigaSpace-ref="gigaspace">

    <property name="template">
        <bean class="com.mydomain.order.OrderWorkflow" p:status="SUBMITTED"/>
    </property>

    <property name="eventListener">
        <bean class="org.openspaces.events.config.MethodEventAdapterFactoryBean"
              p:delegate-ref="authorizeAction"
              p:methodName="execute"/>
    </property>
</bean>


<!--
This container will listen for lease expiration events on the OrderWorkflowSleeper. This class exists for
a relatively short period of time and is solely a means of putting an order "to sleep" to simulate a
processing delay. One use of this is during credit card processing. If there is a communication failure to
the processor, this class wraps the OrderWorkflow and is written to the space for a set period of time.
When the commFailureAction class is executed, the OrderWorkflow is back in play.
-->
<bean id="orderSleeperContainer"
      class="org.openspaces.events.notify.SimpleNotifyEventListenerContainer"
      p:notifyLeaseExpire="true"
      p:gigaSpace-ref="gigaspace">

    <property name="template">
        <bean class="com.mydomain.order.OrderWorkflowSleeper"/>
    </property>

    <property name="eventListener">
        <bean class="org.openspaces.events.config.MethodEventAdapterFactoryBean"
              p:delegate-ref="commFailureAction"
              p:methodName="execute"/>
    </property>
</bean>
2008-09-05 21:57:43 -0500 asked a question Changing the lease timeout with polling container

When using a polling container, the container will write the entry back to the space if the entry is returned from the listener function. What would one do if they wished to affect the lease duration of the write the container is about to perform?

My thought is to perform the space.write(entry, lease) in the listener handler and return null. Is this the preferred approach?

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=2571]{quote}

2008-09-05 21:51:33 -0500 asked a question Polling container takes only once
  1. I write an entry Foo to the space.

  2. I have dumbed down a SimplePollingEventListenerContainer to take any Foo entries out of the space whenever written and invoke my listener.

  3. My listener wraps the Foo in a different POJO (Wrapper) and writes that object to the space with a lease duration of 30 seconds.

  4. I have a SimpleNotifyEventListenerContainer that listens for lease expirations on Wrapper when the time elapses. The container notifies my listener.

  5. My listener unwraps Foo and writes it back to the space.

  6. At this time I would like to say that the process should repeat with step #2 above, but it does not.

The polling container does not recognize that Foo has been written back to the space. I have also tried using a notification container with take option instead of the polling container, but still no luck.

Any ideas?

Edited by: James Cook on Sep 5, 2008 9:52 PM

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=2570]{quote}

2008-08-13 21:55:04 -0500 answered a question Listening for Lease Expirations - The Spring Way?

It's never good form when your name appears on a majority of the posts and you started the thread. ;-)

Perhaps you are referring to: http://www.gigaspaces.com/wiki/displa...

2008-08-13 20:04:17 -0500 answered a question Listening for Lease Expirations - The Spring Way?

I'm not at the point of packaging a PU. I'm just running the application from within my IDE (using org.openspaces.pu.sla.SLA), so I'm not using shared-lib yet. I haven't run into any problems as long as my VMs are pointing at the same entries.

So, how do I listen for lease expirations of a particular POJO type unless I write a class that implements RemoteEventListener? It works just fine and is documented here . Is there a different way to do it?

2008-08-13 08:34:03 -0500 answered a question Listening for Lease Expirations - The Spring Way?

It was pretty trivial to create my own class that extends RemoteEventListener and provide a notification delegate. I bootstrap this class in my Spring configuration.

Now, I just need to figure out why I'm getting the UnusableEntryException ...

2008-08-12 20:54:31 -0500 asked a question Listening for Lease Expirations - The Spring Way?

Is there a means to register for Lease expiration events using the Spring configuration?

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=2529]{quote}