Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix compile error #181

Merged
merged 1 commit into from
Sep 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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