Xtreemfs move a file

49 views
Skip to first unread message

Özge AYAZ

unread,
May 16, 2013, 7:13:39 AM5/16/13
to xtre...@googlegroups.com


Hi ,

I want to replicate a folder other  folder  file under.But  I  didn't make. I use JAVA .

The  code ;

    public void move() throws IOException {
        volume = client.openVolume("test", null, options);
     //   volume.setXAttr(userCredentials, "bar.txt/",ReplicaUpdatePolicies.REPL_UPDATE_PC_WARONE, "WqR1", MRC.XATTR_FLAGS.XATTR_FLAGS_CREATE);
        Replica.Builder newReplicaBuilder = Replica.newBuilder();
        List<String> osds = null;
        osds = volume.getSuitableOSDs(userCredentials, "bar.txt/", 2);
        newReplicaBuilder.addAllOsdUuids(osds);
        Replica newReplica = newReplicaBuilder.build();
        try {
            // add replica
            volume.addReplica(userCredentials, "user/", newReplica);
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }


I  want  to replicate  file  "bla.txt". I  want  to replicate   "user"  folder  under.


Error ;

Exception in thread "main" com.google.protobuf.UninitializedMessageException: Message missing required fields: replication_flags, striping_policy
    at com.google.protobuf.AbstractMessage$Builder.newUninitializedMessageException(AbstractMessage.java:550)
    at org.xtreemfs.pbrpc.generatedinterfaces.GlobalTypes$Replica$Builder.build(GlobalTypes.java:1655)
    at xtreemfs.XtreemFSTesting.move(XtreemFSTesting.java:122)
    at xtreemfs.XtreemFSTesting.main(XtreemFSTesting.java:137)


I  make ought.Please  help  me

Michael Berlin

unread,
May 16, 2013, 7:50:59 AM5/16/13
to xtre...@googlegroups.com

Hi,

 

The exception already states the problem:

 

UninitializedMessageException: Message missing required fields: replication_flags, striping_policy

 

If you look for examples how to use the libxtreemfs for Java, have a look at the JUnit tests of libxtreemfs. Here’s a good example: https://code.google.com/p/xtreemfs/source/browse/java/servers/test/org/xtreemfs/common/libxtreemfs/VolumeTest.java#512

 

replication_flags can be “0” for r/w replicated flags.

 

Also, do not add all OSD UUIDs to the replica:         newReplicaBuilder.addAllOsdUuids(osds);

 

Instead, pick one e.g, the first one returned by getSuitableOSDs().

 

Best regards,

Michael

 

--
 
---
You received this message because you are subscribed to the Google Groups "XtreemFS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xtreemfs+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Özge AYAZ

unread,
May 17, 2013, 8:41:21 AM5/17/13
to xtre...@googlegroups.com
Hi  ,

This  line error 

String osdUUID = volume.getSuitableOSDs(userCredentials, "bar.txt", 1).get(0);

"bar.txt"   a  file  and  volume be  into

This  code ;


   public void move() throws IOException {
            volume = client.openVolume("ozge2", null, options);

     //   volume.setXAttr(userCredentials, "bar.txt/",ReplicaUpdatePolicies.REPL_UPDATE_PC_WARONE, "WqR1", MRC.XATTR_FLAGS.XATTR_FLAGS_CREATE);
        Replica.Builder newReplicaBuilder = Replica.newBuilder();
        List<String> osds = null;       
        String osdUUID = volume.getSuitableOSDs(userCredentials, "detaysoft.txt", 1).get(0);
        osds.add(osdUUID);
        newReplicaBuilder.addOsdUuids(osds.get(0));

        Replica newReplica = newReplicaBuilder.build();
        try {
            // add replica
            volume.addReplica(userCredentials, "testing3/", newReplica);
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }


The  error ;

[ D | RPCNIOSocketClient   | main            |   1 | May 17 15:29:27 ] connection created
[ D | RPCNIOSocketClient   | main            |   1 | May 17 15:29:27 ] socket send buffer size: 8192
[ D | RPCNIOSocketClient   | main            |   1 | May 17 15:29:27 ] socket receive buffer size: 131071
[ D | RPCNIOSocketClient   | main            |   1 | May 17 15:29:27 ] local bind point: /192.168.2.116
[ D | RPCNIOSocketClient   | Volume          |  11 | May 17 15:29:27 ] connected from /192.168.2.116:37485 to /192.168.2.155:32636
[ D | RPCClientRequest     | Volume          |  11 | May 17 15:29:27 ] sending record marker: 37/20/0
[ D | RPCClientRequest     | Volume          |  11 | May 17 15:29:27 ] send buffer #1: ReusableBuffer( capacity=8192 limit=57 position=0)
[ D | RPCNIOSocketClient   | Volume          |  11 | May 17 15:29:27 ] sent request 243019 to /192.168.2.155:32636
[ D | RPCResponse          | Volume          |  11 | May 17 15:29:27 ] response received
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0
    at java.util.Collections$EmptyList.get(Collections.java:3204)
    at xtreemfs.XtreemFSTesting.move(XtreemFSTesting.java:121)
    at xtreemfs.XtreemFSTesting.main(XtreemFSTesting.java:157)
[ D | UUIDResolver         | UUID Resolver   |  10 | May 17 15:29:30 ] removed entry from UUID cache: 67faccb8-acf2-4e5f-8cda-d96a398ef19d






2013/5/16 Michael Berlin <michael.ber...@gmail.com>

--
 
---
You received this message because you are subscribed to a topic in the Google Groups "XtreemFS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/xtreemfs/1SkJrs3R69s/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to xtreemfs+u...@googlegroups.com.

Michael Berlin

unread,
May 17, 2013, 9:06:47 AM5/17/13
to xtre...@googlegroups.com
Hi,

On 05/17/2013 02:41 PM, �zge AYAZ wrote:
> String osdUUID = volume.getSuitableOSDs(userCredentials, "bar.txt",
> 1).get(0);

[...]

> The error ;
> Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0

Apparently, there are no more OSDs available i.e., the file is already
placed on all available OSDs or you have a custom OSD selection policy
in place which limits the list of selectable OSDs. Probably the first.
Start more OSDs in that case. The MRC webinterface gives a nice list of
"selectable OSDs" for your volume.

Best regards,
Michael

Özge AYAZ

unread,
May 18, 2013, 3:26:01 PM5/18/13
to xtre...@googlegroups.com
Hi ,

The MRC  webinterface  addition . I  change  and  add  line  newReplicaBuilder.setReplicationFlags(0);


public void move() throws IOException {
            volume = client.openVolume("ozge", null, options);

     //   volume.setXAttr(userCredentials, "bar.txt/",ReplicaUpdatePolicies.REPL_UPDATE_PC_WARONE, "WqR1", MRC.XATTR_FLAGS.XATTR_FLAGS_CREATE);
        Replica.Builder newReplicaBuilder = Replica.newBuilder();
        List<String> osds = null;       
        String osdUUID = volume.getSuitableOSDs(userCredentials, "testing/testing1.txt", 1).get(0);
        osds.add(osdUUID);
        newReplicaBuilder.addOsdUuids(osds.get(0));
        newReplicaBuilder.setReplicationFlags(0);

        Replica newReplica = newReplicaBuilder.build();
        try {
            // add replica
            volume.addReplica(userCredentials, "testing2/", newReplica);
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }

The Error ;

[ D | RPCClientRequest     | Volume          |  11 | May 18 22:24:03 ] send buffer #1: ReusableBuffer( capacity=8192 limit=70 position=0)
[ D | RPCNIOSocketClient   | Volume          |  11 | May 18 22:24:03 ] sent request 609095 to /192.168.1.2:32636

Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0
[ D | RPCResponse          | Volume          |  11 | May 18 22:24:03 ] response received
    at java.util.Collections$EmptyList.get(Collections.java:3204)
    at xtreemfs.XtreemFSTesting.move(XtreemFSTesting.java:123)
    at xtreemfs.XtreemFSTesting.main(XtreemFSTesting.java:167)




2013/5/17 Michael Berlin <michael.ber...@gmail.com>
Hi,
--

--- You received this message because you are subscribed to a topic in the Google Groups "XtreemFS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/xtreemfs/1SkJrs3R69s/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to xtreemfs+unsubscribe@googlegroups.com.
Screen.png

Michael Berlin

unread,
May 21, 2013, 11:46:11 AM5/21/13
to xtre...@googlegroups.com
Hi,

You're still running into the same error: getSuitableOSDs() returns no
free OSDs.

Quote from my previous mail:

> Apparently, there are no more OSDs available i.e., the file is
> already placed on all available OSDs or you have a custom OSD
> selection policy in place which limits the list of selectable OSDs.
> Probably the first. Start more OSDs in that case. The MRC
> webinterface gives a nice list of "selectable OSDs" for your volume.


Nonetheless, please describe what you're actually trying to achieve. It
looks like you actually want to move a file from a certain path to
another one.

But: Replicas are *not meant* to move files between directories. Adding
or deleting replicas allows you to create or remove additional,
identical copies of the same file for increased availability, durability
or load balancing/higher throughput.

If you want to move a file within the file system tree, use the rename()
function of the libxtreemfs for Java library:
http://code.google.com/p/xtreemfs/source/browse/java/servers/src/org/xtreemfs/common/libxtreemfs/Volume.java#269

Best regards,
Michael
> sent request 609095 to /192.168.1.2:32636 <http://192.168.1.2:32636>
> Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0
> [ D | RPCResponse | Volume | 11 | May 18 22:24:03 ]
> response received
> at java.util.Collections$EmptyList.get(Collections.java:3204)
> at xtreemfs.XtreemFSTesting.move(XtreemFSTesting.java:123)
> at xtreemfs.XtreemFSTesting.main(XtreemFSTesting.java:167)
>
>
>
>
> 2013/5/17 Michael Berlin <michael.ber...@gmail.com
> <mailto:michael.ber...@gmail.com>>
>
> Hi,
>
>
> On 05/17/2013 02:41 PM, �zge AYAZ wrote:
>
> String osdUUID = volume.getSuitableOSDs(__userCredentials,
> "bar.txt",
> 1).get(0);
>
>
> [...]
>
> The error ;
>
> Exception in thread "main"
> java.lang.__IndexOutOfBoundsException: Index: 0
>
>
> Apparently, there are no more OSDs available i.e., the file is
> already placed on all available OSDs or you have a custom OSD
> selection policy in place which limits the list of selectable OSDs.
> Probably the first. Start more OSDs in that case. The MRC
> webinterface gives a nice list of "selectable OSDs" for your volume.
>
> Best regards,
> Michael
>
>
> --
>
> --- You received this message because you are subscribed to a topic
> in the Google Groups "XtreemFS" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/__topic/xtreemfs/1SkJrs3R69s/__unsubscribe?hl=en
> <https://groups.google.com/d/topic/xtreemfs/1SkJrs3R69s/unsubscribe?hl=en>.
> To unsubscribe from this group and all its topics, send an email to
> xtreemfs+unsubscribe@__googlegroups.com
> <mailto:xtreemfs%2Bunsu...@googlegroups.com>.
> For more options, visit https://groups.google.com/__groups/opt_out
> <https://groups.google.com/groups/opt_out>.
>
>
>
> --
>
> ---
> You received this message because you are subscribed to the Google
> Groups "XtreemFS" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to xtreemfs+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages