-
Notifications
You must be signed in to change notification settings - Fork 3
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
[Page File 관리] 로키 미션 제출합니다. #2
base: HaiSeong
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
구현 잘해주셨네요! 특히 테스트 부분이 이상적이에요 :)
간단한 코멘트 남겼으니 확인 부탁드려요!
private final Map<String, PagedFile> openFiles; | ||
|
||
public PagedFileManager(Map<String, PagedFile> openFiles) { | ||
this.openFiles = openFiles; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[질문] open된 파일을 메모리에서 갖고 있는 것이 어떤 이점이 있나요?
@@ -1,19 +1,34 @@ | |||
package database.page; | |||
|
|||
public class Page { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Serializable에 대해 학습해보면 좋을것 같습니다.
@@ -3,7 +3,8 @@ | |||
public class Application { | |||
|
|||
public static void main(String[] args) { | |||
DatabaseServer server = new DatabaseServer(3306); | |||
ParameterHandler parameterHandler = new ParameterHandler(args); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
|
||
public class ParameterHandler { | ||
|
||
private static final Map<String, String> DEFAULT_OPTIONS = Map.of( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저도 적용해봐야겠네요 👍🏻
public Page getPage(PageId pageId) { | ||
if (!pageBuffer.containsKey(pageId)) { | ||
return null; | ||
} | ||
return pageBuffer.get(pageId); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional을 활용해보는 것은 어떠신가요?
} | ||
|
||
public long getPageNum() { | ||
public int getPageNum() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저도 고민했던 사항인데, 페이지 번호는 평균적으로 int 범위를 넘어갈 정도로 많나요?(궁금)
private static final String testFileName = "testfile.db"; | ||
private static final String oldFileName = "oldFile.db"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
파일 확장자가 db인 이유가 있나요?
페이지는 어떻게 구성되나요?
페이지 교체 알고리즘은 어떤 것으로 결정하고, 왜 결정했나요?
PageReplacementPolicy
인터페이스로 추상화 하였습니다.스크레치 페이지