Run the Client file in Riak

11 views
Skip to first unread message

shatakshi

unread,
Sep 15, 2012, 5:45:12 PM9/15/12
to BG-Social...@googlegroups.com

Hello,

 I am using Riak as my database. I have written the RiakDbClient.java code which opens the connection to the server and creates the schema. But I dont know how to run it so that I can test whether I have done the correct thing or not.

In the assignment slides it is mentioned that we have to run the Client.java file and -schema –db dbxDataStore.dbxClient –p command but I am not able to understand where is this Client.java and from where this command needs to be run.

Thanks.

Shahram Ghandeharizadeh

unread,
Sep 15, 2012, 8:39:41 PM9/15/12
to BG-Social...@googlegroups.com
Good job on authoring your RiakDbClient.java file.  This file is your Client.java file and the same as dbxDataSotre.dbxClient.

To proceed forward with compiling and running your client file, have a careful look at the tutorial for MongoDB, see http://dblab.usc.edu/users/bg/tutorial.htm for details.  Follow the steps in QuickStart.  The key difference is that you'll be performing these steps against your Riak directory instead of MongoDB.
Shahram.

shatakshi goyal

unread,
Sep 15, 2012, 9:01:41 PM9/15/12
to bg-social...@googlegroups.com
Thank you professor.

--
You received this message because you are subscribed to the Google Groups "BG Social Benchmark" group.
To unsubscribe from this group, send email to BG-SocialBenchm...@googlegroups.com.
Visit this group at http://groups.google.com/group/BG-SocialBenchmark?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Thanks
Shatakshi


shatakshi

unread,
Sep 15, 2012, 9:57:34 PM9/15/12
to BG-Social...@googlegroups.com
Hello,
 I am trying to run the following command from command line-
ant dbcompile-mongodb
 to see how and whether the mongodb compilation is successful or not.

But it is giving me the following error : The following error occurred while executing this line:
/home/shatakshi/workspace1/BG/build.xml:114: srcdir "/home/shatakshi/workspace1/BG/db/mongodb/src" does not exist!

Am I missing something?



On Saturday, September 15, 2012 2:45:12 PM UTC-7, shatakshi wrote:

Sumita Barahmand

unread,
Sep 15, 2012, 10:06:00 PM9/15/12
to bg-social...@googlegroups.com
Hi,

go to your build.xml file which is in the BG folder and change 
<target name="dbcompile-mongodb" depends="compile">
    <property name="db.dir" value="db/mongodb"/>
    <antcall target="dbcompile"/>
  </target>



to 


<target name="dbcompile-mongodb" depends="compile">
    <property name="db.dir" value="db/MongoDB"/>
    <antcall target="dbcompile"/>
  </target>


then in the command prompt type ant clean, then ant and finally ant dbcompile-mongodb. And lemme know if it works.


Sumita

--

shatakshi

unread,
Sep 15, 2012, 10:10:37 PM9/15/12
to BG-Social...@googlegroups.com
Yes it worked . Build was successful after changing the build.xml file.
Thanks Sumita.


On Saturday, September 15, 2012 2:45:12 PM UTC-7, shatakshi wrote:

shatakshi

unread,
Sep 15, 2012, 10:34:27 PM9/15/12
to BG-Social...@googlegroups.com
After building MongoDB through 'ant' I am trying to run the command as mentioned in the BG tutorial . The command is :

java -Xmx1G -cp Documents/BG/build/bg.jar;Documents/BG/db/mongodb/lib/*;Documents/BG/build/classes/com/yahoo/ycsb/db com.yahoo.ycsb.Client -schema -db MongoDB.MongoDbClient -p mongodb.writeConcern=normal -p mongodb.database=benchmark -p mongodb.url=10.0.0.122:27017

But it is showing an error saying that the usage of java command is wrong. Do I need to change anything in this command to execute schema for mongo?

Thanks

Sumita Barahmand

unread,
Sep 15, 2012, 10:38:23 PM9/15/12
to bg-social...@googlegroups.com
Hi,

1. First of all you need to make sure the java_home is set and the java command is executable from your command line. I think you must be having some problem in this step.

2. All the paths specified in the example such as  "Documents/BG/build/bg.jar " should be change to the path you have currently copied ur BG code to.

3. You should run the MongoDB server.


Sumita

--

shatakshi

unread,
Sep 15, 2012, 11:49:40 PM9/15/12
to BG-Social...@googlegroups.com, bg-social...@googlegroups.com
Hi,
  I have set my Java home variable and java is working fine now. When I am rewriting the same command using my path for BG still I am getting the same error. The error says:

Usage: java [-options] class [args...]
           (to execute a class)
   or  java [-options] -jar jarfile [args...]
           (to execute a jar file)
where options include:
    -d32      use a 32-bit data model if available
    -d64      use a 64-bit data model if available
    -server      to select the "server" VM
    -jamvm      to select the "jamvm" VM
    -cacao      to select the "cacao" VM
    -zero      to select the "zero" VM
                  The default VM is server.

    -cp <class search path of directories and zip/jar files>
    -classpath <class search path of directories and zip/jar files>
                  A : separated list of directories, JAR archives,
                  and ZIP archives to search for class files.
    -D<name>=<value>
                  set a system property
    -verbose[:class|gc|jni]
                  enable verbose output
    -version      print product version and exit
    -version:<value>
                  require the specified version to run
    -showversion  print product version and continue
    -jre-restrict-search | -jre-no-restrict-search
                  include/exclude user private JREs in the version search
    -? -help      print this help message
    -X            print help on non-standard options
    -ea[:<packagename>...|:<classname>]
    -enableassertions[:<packagename>...|:<classname>]
                  enable assertions with specified granularity
    -da[:<packagename>...|:<classname>]
    -disableassertions[:<packagename>...|:<classname>]
                  disable assertions with specified granularity
    -esa | -enablesystemassertions
                  enable system assertions
    -dsa | -disablesystemassertions
                  disable system assertions
    -agentlib:<libname>[=<options>]
                  load native agent library <libname>, e.g. -agentlib:hprof
                  see also, -agentlib:jdwp=help and -agentlib:hprof=help
    -agentpath:<pathname>[=<options>]
                  load native agent library by full pathname
    -javaagent:<jarpath>[=<options>]
                  load Java programming language agent, see java.lang.instrument
    -splash:<imagepath>
                  show splash screen with specified image

bash: ~workspace1/BG/db/mongodb/lib/*: No such file or directory
bash: ~workspace1/BG/build/classes/com/yahoo/ycsb/db: No such file or directory.

What should I do?
Sumita

To unsubscribe from this group, send email to BG-SocialBenchmark+unsub...@googlegroups.com.

shatakshi

unread,
Sep 16, 2012, 3:37:13 AM9/16/12
to BG-Social...@googlegroups.com, bg-social...@googlegroups.com
Hi,
 My DB- Riak works only on Linux. I am using ubuntu. When I am writing the command
java -Xmx1G -cp Documents/BG/build/bg.jar;Documents/BG/db/mongodb/lib/*;Documents/BG/build/classes/com/yahoo/ycsb/db com.yahoo.ycsb.Client -schema -db MongoDB.MongoDbClient -p mongodb.writeConcern=normal -p mongodb.database=benchmark -p mongodb.url=10.0.0.122:27017

with my parameter values it is not recognizing the -Xmx1G option . Moreover if I try to run it without this option , it is giving the error:

 Exception in thread "main" java.lang.NoClassDefFoundError: :
Caused by: java.lang.ClassNotFoundException: :
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)

Is this because I am not able to see any db folder inside ycsb? Or is this because of some linux issue? It is working fine on windows.

Thanks

abinesh td

unread,
Sep 16, 2012, 3:42:07 AM9/16/12
to bg-social...@googlegroups.com
I haven't understood whether or not it is working on linux for you, but please check your classpath separator. 
To unsubscribe from this group, send email to BG-SocialBenchm...@googlegroups.com.

shatakshi

unread,
Sep 16, 2012, 3:47:07 AM9/16/12
to BG-Social...@googlegroups.com
Yea Correct. I am doing this only :

java -cp /home/shatakshi/workspace1/build/bg.jar : /home/shatakshi/workspace1/BG/db/MongoDB/lib/* : /home/shatakshi/workspace1/BG/build/classes/com/yahoo/ycsb/db com.yahoo.ycsb.Client -schema -db MongoDB.MongoDbClient -p mongodb.writeConcern=normal -p mongodb.database=benchmark -p mongodb.url=10.0.0.122:27017

But it is still giving the error:

Exception in thread "main" java.lang.NoClassDefFoundError: :
Caused by: java.lang.ClassNotFoundException: :
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: :. Program will exit.


What to do?



On Saturday, September 15, 2012 2:45:12 PM UTC-7, shatakshi wrote:

abinesh td

unread,
Sep 16, 2012, 4:00:07 AM9/16/12
to bg-social...@googlegroups.com
Try running without space between different classpath entries and with double quotes around the list of classpaths. 

java -cp "/home/shatakshi/workspace1/build/bg.jar:/home/shatakshi/workspace1/BG/db/MongoDB/lib/*:/home/shatakshi/workspace1/BG/build/classes/com/yahoo/ycsb/db" com.yahoo.ycsb.Client -schema -db MongoDB.MongoDbClient -p mongodb.writeConcern=normal -p mongodb.database=benchmark -p mongodb.url=10.0.0.122:27017 

--

shatakshi

unread,
Sep 16, 2012, 4:05:45 AM9/16/12
to BG-Social...@googlegroups.com
Still the same.
My input was :

java -cp "/home/shatakshi/workspace1/build/bg.jar":"/home/shatakshi/workspace1/BG/db/MongoDB/lib/*":"/home/shatakshi/workspace1/BG/build/classes/com/yahoo/ycsb/db" com.yahoo.ycsb.Client -Xmx1G -schema -db MongoDB.MongoDbClient -p mongodb.writeConcern=normal -p mongodb.database=benchmark -p mongodb.url=10.0.0.122:27017


The output was:
Exception in thread "main" java.lang.NoClassDefFoundError: com/yahoo/ycsb/Client
Caused by: java.lang.ClassNotFoundException: com.yahoo.ycsb.Client

    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: com.yahoo.ycsb.Client. Program will exit.

No luck yet.



On Saturday, September 15, 2012 2:45:12 PM UTC-7, shatakshi wrote:

abinesh td

unread,
Sep 16, 2012, 4:13:26 AM9/16/12
to bg-social...@googlegroups.com
Sorry to not have been clear enough, but I didn't mean to ask you to put double quotes around each of classpath entries, but I meant that you should put it once around the whole list. So it should be as follows:

java -cp "/home/shatakshi/workspace1/build/bg.jar:/home/shatakshi/workspace1/BG/db/MongoDB/lib/*:/home/shatakshi/workspace1/BG/build/classes/com/yahoo/ycsb/db" com.yahoo.ycsb.Client -schema -db MongoDB.MongoDbClient -p mongodb.writeConcern=normal -p mongodb.database=benchmark -p mongodb.url=10.0.0.122:27017 

If the above doesn't work, I am out of ideas.

Try without -Xmx flag so that you solve the classpath problem independent of the flag. With -Xmx, it might be the placement of flag that could be the issue.

--

shatakshi

unread,
Sep 16, 2012, 4:19:31 AM9/16/12
to BG-Social...@googlegroups.com
Tried this also. Still Not working .

On Saturday, September 15, 2012 2:45:12 PM UTC-7, shatakshi wrote:

karan singh

unread,
Sep 16, 2012, 5:22:18 AM9/16/12
to bg-social...@googlegroups.com
An easier option for you would be first test your plugin from with Eclipse. Create a new RunConfiguration, provide the parameters and try running your plugin from inside eclipse. That would take care of the class path issue. Once you have tested your plugin and you want to run BG from the command line, you can then export your project as a Runnable jar. When creating a runnable jar just exclude the clients you are not interested in.
Handling classpath in Java can get messy.

hope this helps.

-Karan

On Sun, Sep 16, 2012 at 1:05 AM, shatakshi <goyalsh...@gmail.com> wrote:
--

shatakshi

unread,
Sep 16, 2012, 5:58:05 AM9/16/12
to BG-Social...@googlegroups.com, bg-social...@googlegroups.com
Thanks a lot Karan. It was great help.
To unsubscribe from this group, send email to BG-SocialBenchmark+unsub...@googlegroups.com.

shatakshi

unread,
Sep 16, 2012, 3:09:24 PM9/16/12
to BG-Social...@googlegroups.com, bg-social...@googlegroups.com
Hello,
 I am trying to run my RiakDbClient file as was done with mongodb, using the same commands but for my project, but I am getting the following error:

Loading workload...
Starting benchmark.
Creating data store schema...
java.lang.ClassNotFoundException: riak.RiakDbClient

    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
    at com.yahoo.ycsb.DBFactory.newDB(DBFactory.java:35)
    at com.yahoo.ycsb.Client.main(Client.java:1128)

Exception in thread "main" java.lang.NullPointerException
    at com.yahoo.ycsb.Client.main(Client.java:1129)

What problem can it be? Since I was having problems with running it from the terminal , I am running it passing the arguments and parameters from eclipse itself. It was working fine for mongodb but not for this.

Shahram Ghandeharizadeh

unread,
Sep 16, 2012, 3:16:21 PM9/16/12
to bg-social...@googlegroups.com
It would help to provide:
- The arguments you are using to run,
- A snapshot of your eclipse screen and its directory structure - make sure to expand the package riak so that your snapshot captures its content.
Shahram.

To unsubscribe from this group, send email to BG-SocialBenchm...@googlegroups.com.

shatakshi

unread,
Sep 16, 2012, 3:26:46 PM9/16/12
to BG-Social...@googlegroups.com, bg-social...@googlegroups.com
Hello Professor,
 I have attached the screenshots for my Riak Directory structure in Eclipse and the arguments that I am passing as command line parameters.
Thanks
To unsubscribe from this group, send email to BG-SocialBenchmark+unsubscribe@googlegroups.com.
Screenshot from 2012-09-16 12:21:43.png
Screenshot from 2012-09-16 12:22:05.png
Screenshot from 2012-09-16 12:24:28.png

karan singh

unread,
Sep 16, 2012, 4:46:56 PM9/16/12
to bg-social...@googlegroups.com

You will need to pass the required driver class as one of the parameters .. u should use db.driver key for that .. also add the external library to your project class path .. that should fix this issue

To unsubscribe from this group, send email to BG-SocialBenchm...@googlegroups.com.

karan singh

unread,
Sep 16, 2012, 4:50:01 PM9/16/12
to bg-social...@googlegroups.com

Since your are running it from eclipse you don't need to mention the classpath explicitly in vm arguments .. just right click on project .. then click configure classpath .. then add all the external dependencies there

shatakshi

unread,
Sep 16, 2012, 6:13:48 PM9/16/12
to BG-Social...@googlegroups.com, bg-social...@googlegroups.com
Hi Karan,
 Can you please elaborate on this matter. I had included all the external jar files in Class path and build path, Moreover the driver for riak is mentioned as "riak-client" but when I add
-db.driver riak-client in the arguments field of eclipse it is saying that db.driver is unrecognized option.

I am unable to understand why it is not able to access this  RiakDbclient.java in BG. If I am running the same riakclient code from another eclipse project The connection is getting established .
What to do?

karan singh

unread,
Sep 16, 2012, 7:16:08 PM9/16/12
to bg-social...@googlegroups.com
the driver specified should be a fully qualified class name of the form db.driver=com.a.b.c.DataStoreDriver

to make sure BG can find this corresponding class.
Right click Project > Click Buildpath > Configure Build Path > Click Libraries tab > Click Add External jars > Add your Riak jar

Now when you run it , hopefully BG should be able to find the libraries.


To unsubscribe from this group, send email to BG-SocialBenchm...@googlegroups.com.

shatakshi

unread,
Sep 16, 2012, 8:53:44 PM9/16/12
to BG-Social...@googlegroups.com, bg-social...@googlegroups.com
Thanks. It worked by changing the source directory of my RiakDbClient.java file.

shatakshi

unread,
Sep 20, 2012, 5:27:08 AM9/20/12
to BG-Social...@googlegroups.com, bg-social...@googlegroups.com

Hello,
 This is with reference to the Insert operation which has the following arguments : table, key , hashmap, boolean insertimage, int imagesize.
       As Far as I understand the key represents the key of each element liek userid and the hashmap stores the further values for a user like username, password e.t.c. Similarly it will store rid for resource and its attributes like creatorid, type,body e.t.c.

 Here, how will we know that the  keys are represented by what string( for example firstname key can be written as fname or firstname) ?
 
How is the friendship between user and Manipulation depicted in this data ( I mean with respect to the primary key and other values)?

And does this image needs to be inserted as part of the "body" of the resource?

Shahram Ghandeharizadeh

unread,
Sep 20, 2012, 5:22:14 PM9/20/12
to bg-social...@googlegroups.com
Hi,
Excellent questions and comments. 

We are re-writing BG (and updating its documentation) to make it more explicit with the attribute names.  For starters, the latest version by Sumita (posted Sept 20th, at 11 am), had changed the insert method.  The new one is:  int insertEntity(String entitySet, String entityPK, HashMap<String, ByteIterator> values, boolean insertImage, int imageSize).  Note the use entitySet and entityPK.  There are only two entities (based on the conceptual design):  Members and Resources.  Additional comments and documents are needed to make this clear.  The same applies for the attributes.  This should happen with the next release - hopefully tomorrow.
Cheers,
Shahram.
       


--
You received this message because you are subscribed to the Google Groups "BG Social Benchmark" group.
To unsubscribe from this group, send email to BG-SocialBenchm...@googlegroups.com.

abinesh td

unread,
Sep 20, 2012, 5:32:14 PM9/20/12
to bg-social...@googlegroups.com
One idea that I can think of is that we can represent entities in BG as fully functional classes(POJOs, Plain old java objects) such as User, Resource, etc instead of having multidimensional maps(that is hard for developers to follow and onboard a new datastore) and have the DBClient return these objects instead. These classes can be designed without any influence of the underlying data model, keeping in mind only about the application development convenience(BG in this case). The DBClient implementation will then as usual communicate with its datastore and construct the entity objects instead of multidimensional maps. This philosophy is close to today's ORM frameworks such as Hibernate.

Shahram Ghandeharizadeh

unread,
Sep 24, 2012, 2:40:18 PM9/24/12
to BG-Social...@googlegroups.com, bg-social...@googlegroups.com
Shatakshi,
I am not certain of the 2nd and 3rd questions in your e-mail.  Please elaborate on them.

Regarding your first question, we'll make a posting soon. 
Shahram.

Shahram Ghandeharizadeh

unread,
Sep 29, 2012, 10:57:55 AM9/29/12
to BG-Social...@googlegroups.com, bg-social...@googlegroups.com
BG dictates a certain conceptual schema.  This schema consists of three entity sets:  users, resources and comments.
The attributes for each entity are as follows and MUST be present in the data store.  This is because BG actions retrieve these attributes, see discussion of unpredictable data below.  

users(userid, username, pw, fname, lname, gender, dob, jdate, ldate, address, email, tel, tpic, pic)
· The userid is the unique identifier of a user in social networking system.
· The username is the unique user name of a user (profile owner) which is used by the user for login into the social networking system.
· The pw attribute is the password used by a user alongside her username, to login into the social network system.
· fname is the profile owner’s (user’s) first name which is created when the user profile is created.
· lname is the user’s last name which is created when the user profile is created.
· gender is the user’s gender.
· dob contains user’s date of birth.
· jdate is the date and time when the user joined the social networking system.
· ldate is the date in which the user last logged into the social networking system.
· address is user’s address.
· email is the profile owner’s email address.
· tel is the profile owner/user’s telephone number.
· pic is the image which is uploaded by the user for her profile. This image is displayed when any social network member views the user’s profile
· tpic is the thumbnail generated for user’s image. The thumbnail is displayed when the user is listed as another social network member’s friend.

resources( rid, creatorid,walluserid, type, body,doc)
· rid is the unique id for every resource created/posted on the social network system.
· creatorid is the user id /profile id of the user that posted the resource into the social networking system.
· walluserid is the unique user id/profile id of the user that the resource is created/posted for. A creatorid can either post a resource on their own profile (e.g. create a status message), in which the creatorid and the walluserid for the created resource will be the same or may create the resource on a different user’s profile (e.g. post a picture on another user’s profile) in which the creatorid and the walluserid will be different.
· type is the type of the created resource which can be “comment”, “status”, “picture”, etc.
· body is the actual content of the resource. For example for a comment, the body is text in the comment; for a picture this body will contain the bytes of the image
· doc is the date of creation of the resource.

manipulations(mid, creatorid, rid, modifierid, timestamp, type, content)
· mid is the unique key created for every manipulation generated on a resource. This manipulation can be a user commenting on a resource, a user liking the resource by rating it and etc.
· creatorid is the unique identifier of the user who created the resource which a comment is posted on or a rating has happened on.
· RID is the unique id of the resource that is manipulated.
· modifierid is the unique identifier of the user who manipulates the resource either by commenting on it or rating it.
· timestamp is the date and time at which the manipulation is posted.
· type is the type of the manipulation which can be comment, rate and etc.
· content is the actual body of the manipulation. If the manipulation is a comment generated on a resource it will contain the text of the comment; if it is rating it will contain the details of the rating that happened.




To detect unpredictable data, BG requires different actions to provide additional fields and their values (in the result hash map / vector that is provided as input to the actions):

* viewProfile must provide:
1) number of pending friend invitations (key="pendingcount"),
2) number of confirmed friendships (key="friendcount"),
3) number of resources(key="resourcecount"), and
4) each user attribute and its value.
In the absence of the first 3 fields, BG raises exceptions.  Ensure the spelling of the key is consistent with the provided specification.

* listFriends must provide the list of friends for a user.
The result must be populated with the "userid"  for every friend and
all the other user attributes and their values. Ensure the spelling of the key and its case is consistent with the provided specification for attribute names, e.g., userid may not be USERID.

* viewFriendReq must provide the list of pending friendships for a user.
For every invitation, the "userid" of the inviter and all other attributes of the inviter's profile should be inserted in the result hashmap. Ensure the spelling of the key is consistent with the provided specification.

* viewTopKResource returns the top K resources posted on a user's profile.
This function must populate the hashmap with the resource id ("rid"), the "walluserid" (the unique identifier of the profile the resource has been created on) as well as all other resource attributes. Ensure the spellings of the keys are consistent with the provided specification.

* getInitialStats return the initial statistics of the database which contains the user count("usercount"), average number of friends per user ("avgfriendsperuser"), average number of pending requests per user("avgpendingperuser"), and average number of resources per user ("resourcesperuser"). Ensure the spelling of the key is consistent with the provided specification.

shatakshi

unread,
Oct 1, 2012, 5:44:05 PM10/1/12
to BG-Social...@googlegroups.com
Hello,
 I am running my RiakDbClient file for the load operation. But as it loads it gives the following error :

Done creating indexes and closing db connection
java.lang.NullPointerException
    at com.yahoo.ycsb.Client.main(Client.java:1341)
Loading datastore completed.

The error that it is referring to in Client.java class is in the line :
text+= "\t MemberCount=" + userWorkload.getDBInitialStats(db).get("usercount")+"\n";   

What might be the reason for this error in BG?
 The statement I am writing while running my RiakDbClient is :
 -load -db Riak.RiakDbClient -P workloads/populateDB  -p riak.user=localhost -p riak.port=8087 -p db.driver=basho-riak-java-client-bf415bd

Thanks

abinesh td

unread,
Oct 1, 2012, 10:36:29 PM10/1/12
to bg-social...@googlegroups.com
You need to implement getInitialStats method in your DB client. If you had done so already, ensure the keys in the hashmap returned are properly (case sensitivity issues, typos,etc).

--

shatakshi

unread,
Oct 1, 2012, 11:26:06 PM10/1/12
to BG-Social...@googlegroups.com, bg-social...@googlegroups.com
Hi.
Thanks a lot for the reply but sadly that is also not working. What I see is that if I remove the { .get("usercount")} value from the statement 
text+= "\t MemberCount=" + userWorkload.getDBInitialStats(db).get("usercount")+"\n";
it still loads to show the following output

Load configuration parameters (those missing from the list have default values):

riak.port: 8087
useroffset: 0
confperc: 1
riak.user: localhost
resourcecountperuser: 2
threadcount: 1
manipulationcountperresource: 0
usercount: 1000
friendshipworkload: edu.usc.bg.workloads.FriendshipWorkload
manipulationworkload: edu.usc.bg.workloads.ManipulationWorkload
resourceworkload: edu.usc.bg.workloads.ResourceWorkload
requestdistribution: dzipfian
requestmean: 0.27
friendcountperuser: 10
userworkload: edu.usc.bg.workloads.UserWorkload
db: Riak.RiakDbClient
Stats queried from the data store:
     MemberCount=null
     ResourceCountPerUser=null
     FriendCountPerUser=null
     PendingCountPerUser=null
10 Seconds:  Load is in progress
state thread came out of while
load state thread exited
Loading datastore completed.

But even if I am passing the required stat  usercount, resourcesperuser e.t.c with the values null , implemented in my RiakDbClient file ,it is giving the same error : Null pointer Exception in the line:

 text+= "\t MemberCount=" + userWorkload.getDBInitialStats(db).get("usercount")+"\n";
Is it because

One more thing is that I am printing some dummy print statements in Create Schema as well as InsertEntity function, but neither of the two statements are getting printed  when I am running my file with -schema option as well as -load option.
any idea what might be the problem?
To unsubscribe from this group, send email to BG-SocialBenchmark+unsub...@googlegroups.com.

Shahram Ghandeharizadeh

unread,
Oct 1, 2012, 11:36:18 PM10/1/12
to bg-social...@googlegroups.com
When passing the required stats (usercount, resourceperuser, etc.,), try to provide a value other than null, say 10.  Will the error go away?
Shahram.
P.S., Of course, the value "10" is only a place holder and the appropriate value must be computed and provided.

shatakshi

unread,
Oct 1, 2012, 11:44:20 PM10/1/12
to BG-Social...@googlegroups.com, bg-social...@googlegroups.com
Hello Professor,
 Even after giving this dummy value it is giving the error. I am trying to print some simple print statements in CreateSchema and InsertEntity functions to know the flow of operation but it is not even printing those statements when running the Client.java file with -schema as well as -load option. If I am writing the same RiakDbClient code and running it with the older BG , it is running just fine , printing all the print statements at the right time and place and also not giving any null pointer Exceptions.
What can be the problem?

shatakshi

unread,
Oct 1, 2012, 11:55:29 PM10/1/12
to BG-Social...@googlegroups.com, bg-social...@googlegroups.com
Thanks it is working to a certain extent now. I had to close everything and recompile the files with ant again.

Shahram Ghandeharizadeh

unread,
Oct 1, 2012, 11:57:30 PM10/1/12
to bg-social...@googlegroups.com
Hi,
It appears that your client code is not being referenced - I assume it is named Riak.RiakDbClient.  I suggest comparing the old settings that work with the new to see what is the difference.  Pay special attention to spelling errors. 

To verify whether your code is being invoked or not, you may want to add println to your init() to see if they show.  Alternatively, use Eclipse in debug mode and set a break point in your init() to see if it executes.  Using the debugger, you should be able to trace it to your createSchema method.
Shahram.

shatakshi

unread,
Oct 2, 2012, 12:00:25 AM10/2/12
to BG-Social...@googlegroups.com, bg-social...@googlegroups.com
Hi Professor,
 It is being referenced now. Had some problem with ant compilation.
Thank you.

Shahram Ghandeharizadeh

unread,
Oct 2, 2012, 12:04:02 AM10/2/12
to bg-social...@googlegroups.com
Yay!

Reply all
Reply to author
Forward
0 new messages