I could figure this out.
In the com.hmsonline.virgil.pool.VirgilConnection class, we have to add the following code:
//added by vamshi
AuthenticationRequest authRequest = new AuthenticationRequest();
Map<String, String> credentials = new HashMap<String, String>();
credentials.put("username", "cassandra");
credentials.put("password", "cassandra");
authRequest.setCredentials(credentials);
try {
if (this.connection != null)
this.connection.login(authRequest);
} catch (AuthenticationException e2) {
System.out.println("unable to login" +e2);
throw new TTransportException("Could not log in: " + e2, e2);
} catch (AuthorizationException e2) {
System.out.println("unable to login" +e2);
throw new TTransportException("Could not log in: " + e2, e2);
} catch (TException e2) {
System.out.println("unable to login" +e2);
throw new TTransportException("Could not log in: " + e2, e2);
}
// //added by vamshi end