The following code will help you get the count for the specific data-rk attribute that you want. For this example, I am searching for a tr element having data-rk attribute "Role1"
First find the table body element by it's ID attribute and then get the string in the permissions count column from within this element as follows:
WebElement table = driver.findElementById("rolesForm:rolesTable_data");
String pCount = table.findElement(By.xpath("/tr[@data-rk=\"Role1\"]/td[2]")).getText();
// The returned object is a string. If you like, you could convert it to an integer
int count = Integer.parseInt(pCount);
Please note that this code will only return the first tr element that satisfies the condition. If your table is going to have multiple tr elements that satisfy this condition, then you will have to create a list of tr elements and then iterate over them to get the count. You can get the list as follows:
WebElement table = driver.findElementById("rolesForm:rolesTable_data");
List<WebElement> rows = table.findElements(By.xpath("/tr[@data-rk=\"Role1\"]);
// Iterate over rows to get each count
for (WebElement row : rows) {
String pCount = row.findElement(By.xpath("/td[2]")).getText();
// Do whatever you want with pCount
}