Skip to content

Commit

Permalink
Merge pull request #181 from DSL-UMD/distributed
Browse files Browse the repository at this point in the history
fix compile error
  • Loading branch information
gangliao authored Sep 23, 2019
2 parents e990cb6 + a5f800c commit f698975
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ long getHeader() {
}
}

public static LoadINode loadINode(final long id) {
public LoadINode loadINode(final long id) {
LoadINode res = null;
try {
DatabaseConnection obj = Database.getInstance().getConnection();
Expand Down Expand Up @@ -135,7 +135,7 @@ public static LoadINode loadINode(final long id) {
return res;
}

public static LoadINode loadINode(final long parentId, final String childName) {
public LoadINode loadINode(final long parentId, final String childName) {
LoadINode res = null;
try {
DatabaseConnection obj = Database.getInstance().getConnection();
Expand Down Expand Up @@ -165,7 +165,8 @@ public static LoadINode loadINode(final long parentId, final String childName) {
String sql =
"SELECT parent, id, name, permission, modificationTime, accessTime, header FROM inodes WHERE parent = ? AND name = ?;";
PreparedStatement pst = conn.prepareStatement(sql);
pst.setLong(1, id);
pst.setLong(1, parentId);
pst.setString(2, childName);
ResultSet rs = pst.executeQuery();
while (rs.next()) {
res =
Expand All @@ -187,7 +188,7 @@ public static LoadINode loadINode(final long parentId, final String childName) {
}

if (LOG.isInfoEnabled()) {
LOG.info("Load INode [GET]: (" + id + ")");
LOG.info("Load INode [GET]: (" + parentId + ", " + childName + ")");
}
return res;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public long size() {
public INode get(long id) {
INode inode = INodeKeyedObjects.getCache().getIfPresent(Long.class, id);
if (inode == null) {
DatabaseINode.LoadINode node = DatabaseINode.loadINode(id);
DatabaseINode.LoadINode node = new DatabaseINode().loadINode(id);
byte[] name = (node.name != null) ? DFSUtil.string2Bytes(node.name) : null;
if (node.header != 0L) {
inode = new INodeFile(node.id);
Expand Down Expand Up @@ -96,7 +96,7 @@ public INode get(long parentId, String childName) {
INodeKeyedObjects.getCache()
.getIfPresent(Pair.class, new ImmutablePair<>((Long) parentId, childName));
if (inode == null) {
DatabaseINode.LoadINode node = DatabaseINode.loadINode(parentId, childName);
DatabaseINode.LoadINode node = new DatabaseINode().loadINode(parentId, childName);
byte[] name = (node.name != null) ? DFSUtil.string2Bytes(node.name) : null;
if (node.header != 0L) {
inode = new INodeFile(node.id);
Expand Down

0 comments on commit f698975

Please sign in to comment.