You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@whirr.apache.org by "David Alves (JIRA)" <ji...@apache.org> on 2011/03/04 03:05:41 UTC

[jira] Created: (WHIRR-246) Single place to store/load cluster state

Single place to store/load cluster state
----------------------------------------

                 Key: WHIRR-246
                 URL: https://issues.apache.org/jira/browse/WHIRR-246
             Project: Whirr
          Issue Type: Improvement
            Reporter: David Alves
            Priority: Minor


Right now cluster state is written and read from the ~/.whirr/cluster-name/instances file and logic to write and update it is spread between the Service and DestroyInstanceCommand (that I know of).

Since for WHIRR-214 the file must be updated (in another class) and for WHIRR-238 an altogether different method of storing cluster state will be required I think it might be time to move the read/write state logic to its own file (or factory in the future).

I'll attach a very preliminary patch just to get some feedback.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (WHIRR-246) Single place to store/load cluster state

Posted by "David Alves (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WHIRR-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13002665#comment-13002665 ] 

David Alves commented on WHIRR-246:
-----------------------------------

Btw I just remembered something that might be relevant.

When updating a cluster we will do so based on the current state, up to now using the local filesystem was not a problem because no decisions (that I know of) were made based on this file. This will change with WHIRR-214 and so a problem might arise where if the cluster is started on one machine and updated on another, update decisions might be based on a non-existing or state state.

> Single place to store/load cluster state
> ----------------------------------------
>
>                 Key: WHIRR-246
>                 URL: https://issues.apache.org/jira/browse/WHIRR-246
>             Project: Whirr
>          Issue Type: Improvement
>            Reporter: David Alves
>            Priority: Minor
>         Attachments: WHIRR-246.patch
>
>
> Right now cluster state is written and read from the ~/.whirr/cluster-name/instances file and logic to write and update it is spread between the Service and DestroyInstanceCommand (that I know of).
> Since for WHIRR-214 the file must be updated (in another class) and for WHIRR-238 an altogether different method of storing cluster state will be required I think it might be time to move the read/write state logic to its own file (or factory in the future).
> I'll attach a very preliminary patch just to get some feedback.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (WHIRR-246) Single place to store/load cluster state

Posted by "Adrian Cole (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WHIRR-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13002671#comment-13002671 ] 

Adrian Cole commented on WHIRR-246:
-----------------------------------

agreed.  when there are 2 heads, local filesystem doesn't seem to help.  However, in the case that there aren't, it should be ok.

> Single place to store/load cluster state
> ----------------------------------------
>
>                 Key: WHIRR-246
>                 URL: https://issues.apache.org/jira/browse/WHIRR-246
>             Project: Whirr
>          Issue Type: Improvement
>            Reporter: David Alves
>            Priority: Minor
>         Attachments: WHIRR-246.patch
>
>
> Right now cluster state is written and read from the ~/.whirr/cluster-name/instances file and logic to write and update it is spread between the Service and DestroyInstanceCommand (that I know of).
> Since for WHIRR-214 the file must be updated (in another class) and for WHIRR-238 an altogether different method of storing cluster state will be required I think it might be time to move the read/write state logic to its own file (or factory in the future).
> I'll attach a very preliminary patch just to get some feedback.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (WHIRR-246) Single place to store/load cluster state

Posted by "Adrian Cole (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WHIRR-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13002655#comment-13002655 ] 

Adrian Cole commented on WHIRR-246:
-----------------------------------

When you say local files, do you mean local to the machines in the cluster?  If so, it is a sort of ssh-based blobstore, right?  If you meant local files to the whirr call, blobstore has a persistent "filesystem" provider that can be used to avoid unnecessary code duplication.

thoughts?

> Single place to store/load cluster state
> ----------------------------------------
>
>                 Key: WHIRR-246
>                 URL: https://issues.apache.org/jira/browse/WHIRR-246
>             Project: Whirr
>          Issue Type: Improvement
>            Reporter: David Alves
>            Priority: Minor
>         Attachments: WHIRR-246.patch
>
>
> Right now cluster state is written and read from the ~/.whirr/cluster-name/instances file and logic to write and update it is spread between the Service and DestroyInstanceCommand (that I know of).
> Since for WHIRR-214 the file must be updated (in another class) and for WHIRR-238 an altogether different method of storing cluster state will be required I think it might be time to move the read/write state logic to its own file (or factory in the future).
> I'll attach a very preliminary patch just to get some feedback.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (WHIRR-246) Single place to store/load cluster state

Posted by "David Alves (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WHIRR-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13002665#comment-13002665 ] 

David Alves edited comment on WHIRR-246 at 3/4/11 3:29 PM:
-----------------------------------------------------------

Btw I just remembered something that might be relevant.

When updating a cluster we will do so based on the current state, up to now using the local filesystem was not a problem because no decisions (that I know of) were made based on this file. This will change with WHIRR-214 and so a problem might arise where if the cluster is started on one machine and updated on another, update decisions might be based on a non-existing or stale state.

      was (Author: dr-alves):
    Btw I just remembered something that might be relevant.

When updating a cluster we will do so based on the current state, up to now using the local filesystem was not a problem because no decisions (that I know of) were made based on this file. This will change with WHIRR-214 and so a problem might arise where if the cluster is started on one machine and updated on another, update decisions might be based on a non-existing or state state.
  
> Single place to store/load cluster state
> ----------------------------------------
>
>                 Key: WHIRR-246
>                 URL: https://issues.apache.org/jira/browse/WHIRR-246
>             Project: Whirr
>          Issue Type: Improvement
>            Reporter: David Alves
>            Priority: Minor
>         Attachments: WHIRR-246.patch
>
>
> Right now cluster state is written and read from the ~/.whirr/cluster-name/instances file and logic to write and update it is spread between the Service and DestroyInstanceCommand (that I know of).
> Since for WHIRR-214 the file must be updated (in another class) and for WHIRR-238 an altogether different method of storing cluster state will be required I think it might be time to move the read/write state logic to its own file (or factory in the future).
> I'll attach a very preliminary patch just to get some feedback.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (WHIRR-246) Single place to store/load cluster state

Posted by "Andrei Savu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WHIRR-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13002501#comment-13002501 ] 

Andrei Savu commented on WHIRR-246:
-----------------------------------

I like the idea of moving the logic for state persistence in a single place. How about storing this info outside the local machine by using the BlobStore API and displaying it as output for ./bin/whirr list-cluster? Should we rename ClusterStore to ClusterState? (more self-explanatory to me)  

> Single place to store/load cluster state
> ----------------------------------------
>
>                 Key: WHIRR-246
>                 URL: https://issues.apache.org/jira/browse/WHIRR-246
>             Project: Whirr
>          Issue Type: Improvement
>            Reporter: David Alves
>            Priority: Minor
>         Attachments: WHIRR-246.patch
>
>
> Right now cluster state is written and read from the ~/.whirr/cluster-name/instances file and logic to write and update it is spread between the Service and DestroyInstanceCommand (that I know of).
> Since for WHIRR-214 the file must be updated (in another class) and for WHIRR-238 an altogether different method of storing cluster state will be required I think it might be time to move the read/write state logic to its own file (or factory in the future).
> I'll attach a very preliminary patch just to get some feedback.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WHIRR-246) Single place to store/load cluster state

Posted by "Andrei Savu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WHIRR-246?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrei Savu updated WHIRR-246:
------------------------------

    Attachment: WHIRR-246.patch

Updated patch and added the missing test for WHIRR-173. I will open a new JIRA for adding blob store state persistence. 

> Single place to store/load cluster state
> ----------------------------------------
>
>                 Key: WHIRR-246
>                 URL: https://issues.apache.org/jira/browse/WHIRR-246
>             Project: Whirr
>          Issue Type: Improvement
>            Reporter: David Alves
>            Assignee: Andrei Savu
>            Priority: Minor
>         Attachments: WHIRR-246.patch, WHIRR-246.patch, WHIRR-246.patch, WHIRR-246.patch
>
>
> Right now cluster state is written and read from the ~/.whirr/cluster-name/instances file and logic to write and update it is spread between the Service and DestroyInstanceCommand (that I know of).
> Since for WHIRR-214 the file must be updated (in another class) and for WHIRR-238 an altogether different method of storing cluster state will be required I think it might be time to move the read/write state logic to its own file (or factory in the future).
> I'll attach a very preliminary patch just to get some feedback.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (WHIRR-246) Single place to store/load cluster state

Posted by "Andrei Savu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WHIRR-246?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrei Savu updated WHIRR-246:
------------------------------

       Resolution: Fixed
    Fix Version/s: 0.5.0
           Status: Resolved  (was: Patch Available)

I've just committed this. Thanks Tom for reviewing. 

> Single place to store/load cluster state
> ----------------------------------------
>
>                 Key: WHIRR-246
>                 URL: https://issues.apache.org/jira/browse/WHIRR-246
>             Project: Whirr
>          Issue Type: Improvement
>            Reporter: David Alves
>            Assignee: Andrei Savu
>            Priority: Minor
>             Fix For: 0.5.0
>
>         Attachments: WHIRR-246.patch, WHIRR-246.patch, WHIRR-246.patch, WHIRR-246.patch
>
>
> Right now cluster state is written and read from the ~/.whirr/cluster-name/instances file and logic to write and update it is spread between the Service and DestroyInstanceCommand (that I know of).
> Since for WHIRR-214 the file must be updated (in another class) and for WHIRR-238 an altogether different method of storing cluster state will be required I think it might be time to move the read/write state logic to its own file (or factory in the future).
> I'll attach a very preliminary patch just to get some feedback.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (WHIRR-246) Single place to store/load cluster state

Posted by "Tom White (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WHIRR-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13025925#comment-13025925 ] 

Tom White commented on WHIRR-246:
---------------------------------

I like this change. A few comments, mainly to do with naming and organization:

* The new by ID instance predicates really belong in RolePredicates with the other ones.
* I would add ClusterStateStore in the org.apache.whirr.service package. It seems odd having a org.apache.whirr.cluster without the Cluster class being in it.
* Change ClusterStateStore to be an abstract class (like Service is) so we have more flexibility over evolving it in the future.
* For consistency with ClusterControllerFactory, ClusterStateStoreFactory should not have static methods. This will make it easier to use the service loader pattern, which we'll need when there are more implementations of ClusterStateStore (to be done in later JIRA?).

> Single place to store/load cluster state
> ----------------------------------------
>
>                 Key: WHIRR-246
>                 URL: https://issues.apache.org/jira/browse/WHIRR-246
>             Project: Whirr
>          Issue Type: Improvement
>            Reporter: David Alves
>            Assignee: Andrei Savu
>            Priority: Minor
>         Attachments: WHIRR-246.patch, WHIRR-246.patch, WHIRR-246.patch
>
>
> Right now cluster state is written and read from the ~/.whirr/cluster-name/instances file and logic to write and update it is spread between the Service and DestroyInstanceCommand (that I know of).
> Since for WHIRR-214 the file must be updated (in another class) and for WHIRR-238 an altogether different method of storing cluster state will be required I think it might be time to move the read/write state logic to its own file (or factory in the future).
> I'll attach a very preliminary patch just to get some feedback.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (WHIRR-246) Single place to store/load cluster state

Posted by "Tom White (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WHIRR-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13026668#comment-13026668 ] 

Tom White commented on WHIRR-246:
---------------------------------

Looks good. +1

Couple of nits:
* The withIds() method on RolePredicates has a method that takes an @Nullable argument, but doesn't check the case for it being null.
* MemoryClusterStateStore might be useful in the main tree, e.g. for clients that use Whirr to run tests from a single JVM. But there's no mechanism to hook it up yet, so could be left until later.

> Single place to store/load cluster state
> ----------------------------------------
>
>                 Key: WHIRR-246
>                 URL: https://issues.apache.org/jira/browse/WHIRR-246
>             Project: Whirr
>          Issue Type: Improvement
>            Reporter: David Alves
>            Assignee: Andrei Savu
>            Priority: Minor
>         Attachments: WHIRR-246.patch, WHIRR-246.patch, WHIRR-246.patch, WHIRR-246.patch
>
>
> Right now cluster state is written and read from the ~/.whirr/cluster-name/instances file and logic to write and update it is spread between the Service and DestroyInstanceCommand (that I know of).
> Since for WHIRR-214 the file must be updated (in another class) and for WHIRR-238 an altogether different method of storing cluster state will be required I think it might be time to move the read/write state logic to its own file (or factory in the future).
> I'll attach a very preliminary patch just to get some feedback.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Updated: (WHIRR-246) Single place to store/load cluster state

Posted by "David Alves (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WHIRR-246?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Alves updated WHIRR-246:
------------------------------

    Status: Patch Available  (was: Open)

A very preliminary patch without tests just to get some feedback

> Single place to store/load cluster state
> ----------------------------------------
>
>                 Key: WHIRR-246
>                 URL: https://issues.apache.org/jira/browse/WHIRR-246
>             Project: Whirr
>          Issue Type: Improvement
>            Reporter: David Alves
>            Priority: Minor
>         Attachments: WHIRR-246.patch
>
>
> Right now cluster state is written and read from the ~/.whirr/cluster-name/instances file and logic to write and update it is spread between the Service and DestroyInstanceCommand (that I know of).
> Since for WHIRR-214 the file must be updated (in another class) and for WHIRR-238 an altogether different method of storing cluster state will be required I think it might be time to move the read/write state logic to its own file (or factory in the future).
> I'll attach a very preliminary patch just to get some feedback.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (WHIRR-246) Single place to store/load cluster state

Posted by "David Alves (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WHIRR-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13002544#comment-13002544 ] 

David Alves commented on WHIRR-246:
-----------------------------------

I've been wrestling with names (started with ClusterStateStore), but ClusterState sounds good.

My reasoning was that first we could start by abstracting state persistence and later on we could introduce a factory that would allow multiple implementations (local file, blobstore, the nodes themselves, etc.).

What do you think? Simply use the blobstore as the only implementation of have multiple ones?




> Single place to store/load cluster state
> ----------------------------------------
>
>                 Key: WHIRR-246
>                 URL: https://issues.apache.org/jira/browse/WHIRR-246
>             Project: Whirr
>          Issue Type: Improvement
>            Reporter: David Alves
>            Priority: Minor
>         Attachments: WHIRR-246.patch
>
>
> Right now cluster state is written and read from the ~/.whirr/cluster-name/instances file and logic to write and update it is spread between the Service and DestroyInstanceCommand (that I know of).
> Since for WHIRR-214 the file must be updated (in another class) and for WHIRR-238 an altogether different method of storing cluster state will be required I think it might be time to move the read/write state logic to its own file (or factory in the future).
> I'll attach a very preliminary patch just to get some feedback.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (WHIRR-246) Single place to store/load cluster state

Posted by "David Alves (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WHIRR-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13002661#comment-13002661 ] 

David Alves commented on WHIRR-246:
-----------------------------------

{quote}When you say local files, do you mean local to the machines in the cluster?{quote}
I'm pretty sure Tom meant local files as they are now (stored locally in the command-issuing machine).

I envision at least three alternatives, storing them locally, storing them in a blobstore (e.g. S3) storing them in the nodes themselves (the ssh-based blob-store).

I think we could start by introducing indirection and the local storage facilities and introduce blobstore and/or node storage later on when required.

{quote}One idea that occurred to me was to implement this as a Service wrapper. Could this work/is it desirable?{quote}

What do you mean by this Tom?


> Single place to store/load cluster state
> ----------------------------------------
>
>                 Key: WHIRR-246
>                 URL: https://issues.apache.org/jira/browse/WHIRR-246
>             Project: Whirr
>          Issue Type: Improvement
>            Reporter: David Alves
>            Priority: Minor
>         Attachments: WHIRR-246.patch
>
>
> Right now cluster state is written and read from the ~/.whirr/cluster-name/instances file and logic to write and update it is spread between the Service and DestroyInstanceCommand (that I know of).
> Since for WHIRR-214 the file must be updated (in another class) and for WHIRR-238 an altogether different method of storing cluster state will be required I think it might be time to move the read/write state logic to its own file (or factory in the future).
> I'll attach a very preliminary patch just to get some feedback.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (WHIRR-246) Single place to store/load cluster state

Posted by "Tom White (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WHIRR-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13002650#comment-13002650 ] 

Tom White commented on WHIRR-246:
---------------------------------

+1 to the direction. I think we'll always want to support local files, as not all compute clouds have associated blob stores, and because it's very convenient for short lived clusters to simply use the filesystem. So I think we'll need an abstraction to support local files and blob stores (and others).

One idea that occurred to me was to implement this as a Service wrapper. Could this work/is it desirable?

> Single place to store/load cluster state
> ----------------------------------------
>
>                 Key: WHIRR-246
>                 URL: https://issues.apache.org/jira/browse/WHIRR-246
>             Project: Whirr
>          Issue Type: Improvement
>            Reporter: David Alves
>            Priority: Minor
>         Attachments: WHIRR-246.patch
>
>
> Right now cluster state is written and read from the ~/.whirr/cluster-name/instances file and logic to write and update it is spread between the Service and DestroyInstanceCommand (that I know of).
> Since for WHIRR-214 the file must be updated (in another class) and for WHIRR-238 an altogether different method of storing cluster state will be required I think it might be time to move the read/write state logic to its own file (or factory in the future).
> I'll attach a very preliminary patch just to get some feedback.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (WHIRR-246) Single place to store/load cluster state

Posted by "Tom White (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WHIRR-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13002659#comment-13002659 ] 

Tom White commented on WHIRR-246:
---------------------------------

I meant local to the machine running Whirr, so yes, using the "filesystem" provider would be a simplification.

> Single place to store/load cluster state
> ----------------------------------------
>
>                 Key: WHIRR-246
>                 URL: https://issues.apache.org/jira/browse/WHIRR-246
>             Project: Whirr
>          Issue Type: Improvement
>            Reporter: David Alves
>            Priority: Minor
>         Attachments: WHIRR-246.patch
>
>
> Right now cluster state is written and read from the ~/.whirr/cluster-name/instances file and logic to write and update it is spread between the Service and DestroyInstanceCommand (that I know of).
> Since for WHIRR-214 the file must be updated (in another class) and for WHIRR-238 an altogether different method of storing cluster state will be required I think it might be time to move the read/write state logic to its own file (or factory in the future).
> I'll attach a very preliminary patch just to get some feedback.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (WHIRR-246) Single place to store/load cluster state

Posted by "Andrei Savu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WHIRR-246?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrei Savu reassigned WHIRR-246:
---------------------------------

    Assignee: Andrei Savu

> Single place to store/load cluster state
> ----------------------------------------
>
>                 Key: WHIRR-246
>                 URL: https://issues.apache.org/jira/browse/WHIRR-246
>             Project: Whirr
>          Issue Type: Improvement
>            Reporter: David Alves
>            Assignee: Andrei Savu
>            Priority: Minor
>         Attachments: WHIRR-246.patch, WHIRR-246.patch
>
>
> Right now cluster state is written and read from the ~/.whirr/cluster-name/instances file and logic to write and update it is spread between the Service and DestroyInstanceCommand (that I know of).
> Since for WHIRR-214 the file must be updated (in another class) and for WHIRR-238 an altogether different method of storing cluster state will be required I think it might be time to move the read/write state logic to its own file (or factory in the future).
> I'll attach a very preliminary patch just to get some feedback.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (WHIRR-246) Single place to store/load cluster state

Posted by "David Alves (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WHIRR-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13002723#comment-13002723 ] 

David Alves commented on WHIRR-246:
-----------------------------------

Another issue I just remembered is locking. StateStores should probably lock state pending updates so that no concurrent updates are performed on stale state.

> Single place to store/load cluster state
> ----------------------------------------
>
>                 Key: WHIRR-246
>                 URL: https://issues.apache.org/jira/browse/WHIRR-246
>             Project: Whirr
>          Issue Type: Improvement
>            Reporter: David Alves
>            Priority: Minor
>         Attachments: WHIRR-246.patch, WHIRR-246.patch
>
>
> Right now cluster state is written and read from the ~/.whirr/cluster-name/instances file and logic to write and update it is spread between the Service and DestroyInstanceCommand (that I know of).
> Since for WHIRR-214 the file must be updated (in another class) and for WHIRR-238 an altogether different method of storing cluster state will be required I think it might be time to move the read/write state logic to its own file (or factory in the future).
> I'll attach a very preliminary patch just to get some feedback.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (WHIRR-246) Single place to store/load cluster state

Posted by "David Alves (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WHIRR-246?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Alves updated WHIRR-246:
------------------------------

    Attachment: WHIRR-246.patch

> Single place to store/load cluster state
> ----------------------------------------
>
>                 Key: WHIRR-246
>                 URL: https://issues.apache.org/jira/browse/WHIRR-246
>             Project: Whirr
>          Issue Type: Improvement
>            Reporter: David Alves
>            Priority: Minor
>         Attachments: WHIRR-246.patch
>
>
> Right now cluster state is written and read from the ~/.whirr/cluster-name/instances file and logic to write and update it is spread between the Service and DestroyInstanceCommand (that I know of).
> Since for WHIRR-214 the file must be updated (in another class) and for WHIRR-238 an altogether different method of storing cluster state will be required I think it might be time to move the read/write state logic to its own file (or factory in the future).
> I'll attach a very preliminary patch just to get some feedback.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WHIRR-246) Single place to store/load cluster state

Posted by "Andrei Savu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WHIRR-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13026678#comment-13026678 ] 

Andrei Savu commented on WHIRR-246:
-----------------------------------

> The withIds() method on RolePredicates has a method that takes an @Nullable argument, but doesn't check the case for it being null.

I will fix it before committing. 

> MemoryClusterStateStore might be useful in the main tree

I agree. Let's handle this in WHIRR-288. 

> Single place to store/load cluster state
> ----------------------------------------
>
>                 Key: WHIRR-246
>                 URL: https://issues.apache.org/jira/browse/WHIRR-246
>             Project: Whirr
>          Issue Type: Improvement
>            Reporter: David Alves
>            Assignee: Andrei Savu
>            Priority: Minor
>         Attachments: WHIRR-246.patch, WHIRR-246.patch, WHIRR-246.patch, WHIRR-246.patch
>
>
> Right now cluster state is written and read from the ~/.whirr/cluster-name/instances file and logic to write and update it is spread between the Service and DestroyInstanceCommand (that I know of).
> Since for WHIRR-214 the file must be updated (in another class) and for WHIRR-238 an altogether different method of storing cluster state will be required I think it might be time to move the read/write state logic to its own file (or factory in the future).
> I'll attach a very preliminary patch just to get some feedback.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Updated: (WHIRR-246) Single place to store/load cluster state

Posted by "David Alves (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WHIRR-246?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Alves updated WHIRR-246:
------------------------------

    Attachment: WHIRR-246.patch

Another patch.

- Changed names.
- Introduced Factory.
- Moved to o.a.w.cluster.

Still preliminary

> Single place to store/load cluster state
> ----------------------------------------
>
>                 Key: WHIRR-246
>                 URL: https://issues.apache.org/jira/browse/WHIRR-246
>             Project: Whirr
>          Issue Type: Improvement
>            Reporter: David Alves
>            Priority: Minor
>         Attachments: WHIRR-246.patch, WHIRR-246.patch
>
>
> Right now cluster state is written and read from the ~/.whirr/cluster-name/instances file and logic to write and update it is spread between the Service and DestroyInstanceCommand (that I know of).
> Since for WHIRR-214 the file must be updated (in another class) and for WHIRR-238 an altogether different method of storing cluster state will be required I think it might be time to move the read/write state logic to its own file (or factory in the future).
> I'll attach a very preliminary patch just to get some feedback.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (WHIRR-246) Single place to store/load cluster state

Posted by "Tom White (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WHIRR-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13002727#comment-13002727 ] 

Tom White commented on WHIRR-246:
---------------------------------

What I meant by the Service wrapper was to have an implementation of service that takes a Service and persists its cluster state for it. This was just one way of implementing it, and I'm not wedded to the idea. Another thing to consider is that some users of the API may not need any persistence of state at all (e.g. when running a single VM test - like the integration tests), so we should make it optional, either by having a no-op ClusterState, or by not using a wrapper.

> Single place to store/load cluster state
> ----------------------------------------
>
>                 Key: WHIRR-246
>                 URL: https://issues.apache.org/jira/browse/WHIRR-246
>             Project: Whirr
>          Issue Type: Improvement
>            Reporter: David Alves
>            Priority: Minor
>         Attachments: WHIRR-246.patch, WHIRR-246.patch
>
>
> Right now cluster state is written and read from the ~/.whirr/cluster-name/instances file and logic to write and update it is spread between the Service and DestroyInstanceCommand (that I know of).
> Since for WHIRR-214 the file must be updated (in another class) and for WHIRR-238 an altogether different method of storing cluster state will be required I think it might be time to move the read/write state logic to its own file (or factory in the future).
> I'll attach a very preliminary patch just to get some feedback.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WHIRR-246) Single place to store/load cluster state

Posted by "Andrei Savu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WHIRR-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13026635#comment-13026635 ] 

Andrei Savu commented on WHIRR-246:
-----------------------------------

Tom, did you also took a look at this code while reviewing WHIRR-289? (I want to commit to simplify patch merging)

> Single place to store/load cluster state
> ----------------------------------------
>
>                 Key: WHIRR-246
>                 URL: https://issues.apache.org/jira/browse/WHIRR-246
>             Project: Whirr
>          Issue Type: Improvement
>            Reporter: David Alves
>            Assignee: Andrei Savu
>            Priority: Minor
>         Attachments: WHIRR-246.patch, WHIRR-246.patch, WHIRR-246.patch, WHIRR-246.patch
>
>
> Right now cluster state is written and read from the ~/.whirr/cluster-name/instances file and logic to write and update it is spread between the Service and DestroyInstanceCommand (that I know of).
> Since for WHIRR-214 the file must be updated (in another class) and for WHIRR-238 an altogether different method of storing cluster state will be required I think it might be time to move the read/write state logic to its own file (or factory in the future).
> I'll attach a very preliminary patch just to get some feedback.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (WHIRR-246) Single place to store/load cluster state

Posted by "Andrei Savu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WHIRR-246?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrei Savu updated WHIRR-246:
------------------------------

    Attachment: WHIRR-246.patch

Updated patch for the current trunk and tested on EC2. Next: create a blob store aware cluster state store. 

> Single place to store/load cluster state
> ----------------------------------------
>
>                 Key: WHIRR-246
>                 URL: https://issues.apache.org/jira/browse/WHIRR-246
>             Project: Whirr
>          Issue Type: Improvement
>            Reporter: David Alves
>            Assignee: Andrei Savu
>            Priority: Minor
>         Attachments: WHIRR-246.patch, WHIRR-246.patch, WHIRR-246.patch
>
>
> Right now cluster state is written and read from the ~/.whirr/cluster-name/instances file and logic to write and update it is spread between the Service and DestroyInstanceCommand (that I know of).
> Since for WHIRR-214 the file must be updated (in another class) and for WHIRR-238 an altogether different method of storing cluster state will be required I think it might be time to move the read/write state logic to its own file (or factory in the future).
> I'll attach a very preliminary patch just to get some feedback.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira