This document discusses serverless computing and related technologies. It begins with an introduction to serverless and links to external resources on the topic. It then provides an overview of serverless architectures using AWS Lambda and other serverless AWS services, comparing them to traditional server-based architectures. The document concludes with notes on using Node.js vs Java or Python for serverless development and mentions the Serverless Framework for building serverless apps.
Let's reconsider about collecting logs. Plus, visiting elastic@Moutain View!心 谷本
1. The document discusses reconsidering how logs are processed by examining use cases like visualizing logs in charts, watching logs for issues, and keeping logs for future use.
2. It suggests treating logs as a stream of events and using a log streaming hub to flexibly route logs to tools for viewing, watching, visualizing, and storage.
3. Examples of log streaming systems are shown using technologies like Fluentd, Redis, Amazon Kinesis, and AWS services to process logs in scalable and painless ways.
The document summarizes sessions from JavaOne including collections, performance tuning at Twitter, framework comparisons, JavaEE best practices, JRockit Mission Control, and HotRockit. It also provides details on JavaOne 2012 locations in San Francisco and Tokyo and includes an additional point about Steve Jobs and San Francisco's Silicon Valley region.
1. Redmine is a free and open source project management software written in Ruby on Rails.
2. It is used for issue tracking, project management, time tracking, and more. Some key features include a REST API, integration with other tools like Excel and TaskCoach, and support for multiple databases.
3. The author discusses their experience using Redmine for over 10 years for various projects and teams with thousands of users.
The document discusses recent Java news including OpenJDK collaborating with IBM and Apple, JSR 336 and 337 for Java 7 and 8, Apache resigning from the Java Community Process, the release of the JDK 7 Developer Preview, HotRockit presenting at EclipseCon 2011 from March 21-24, and a reminder to check www.kanjava.com for more information.
21. private List m_list = null;
private int process_file(String str_file_name) {
String str_line;
List list_lines = new ArrayList();
int i_result = read_file(str_file_name, list_lines);
if (i_result == 0) {
List list_record = new ArrayList();
...
22. private List m_list = null;
private int process_file(String str_file_name) {
String str_line;
List list_lines = new ArrayList();
int i_result = read_file(str_file_name, list_lines);
if (i_result == 0) {
List list_record = new ArrayList();
...
メンバ変数だと分
かるよう、先頭に
m_ を付けよう
スネークケースの方が
読みやすいよね
変数は先頭でまとめて宣言
もちろんハンガリアン記法さ!
戻り値を複数返したい時
は、引数に戻り値相当の変数
参照を渡せばいいんだよ
関数の戻り値はもちろん0が正常、
それ以外が異常
23. for (int i = 0; i < list_lines.size(); i++) {
str_line = (String) list_lines.get(i);
Record record = new Record();
i_result = parse_line(str_line, record);
if (i_result != 0) {
return i_result;
}
list_recordord.add(record);
}
m_list = list_record;
return 0;
24. for (int i = 0; i < list_lines.size(); i++) {
str_line = (String) list_lines.get(i);
Record record = new Record();
i_result = parse_line(str_line, record);
if (i_result != 0) {
return i_result;
}
list_recordord.add(record);
}
m_list = list_record;
return 0;
下の関数でエラーが出たら
ちゃんとエラーコードを上に
伝播させないとね
正常終了はいつも
return 0;
26. private List resultList;
private List processFile(String fileName)
throws SystemException {
List lines = readFile(fileName);
List recordList = new ArrayList();
for (int i = 0; i < lines.size(); i++) {
String line = (String) lines.get(i);
Record record = parseLine(line);
recordList.add(record);
}
return recordList;
}
27. private List resultList;
private List processFile(String fileName)
throws SystemException {
List lines = readFile(fileName);
List recordList = new ArrayList();
for (int i = 0; i < lines.size(); i++) {
String line = (String) lines.get(i);
Record record = parseLine(line);
recordList.add(record);
}
return recordList;
}
メンバ変数に接頭辞や
thisはつけない
キャメルケース
エラーはExceptionで
表現して伝播させる
エラーコードではなく
普通に値を返す
変数は
使う直前
に宣言
引数に戻り値への
参照を渡さない
No ハンガリアン
32. private List resultList;
private List processFile(String fileName)
throws SystemException {
List lines = readFile(fileName);
List recordList = new ArrayList();
for (int i = 0; i < lines.size(); i++) {
String line = (String) lines.get(i);
Record record = parseLine(line);
recordList.add(record);
}
return recordList;
}
41. private List processFile(String fileName)
throws SystemException {
List lines = readFile(fileName);
List recordList = new ArrayList();
for (int i = 0; i < lines.size(); i++) {
String line = (String) lines.get(i);
Record record = parseLine(line);
recordList.add(record);
}
return recordList;
}
46. public interface Constants {
public static final int FILE_NOT_FOUND = -1;
public static final int FILE_READ_ERROR = -2;
public static final int FILE_EMPTY = -3;
public static final int RECORD_EMPTY = -4;
public static final int RECORD_SIZE_ERROR = -5;
public static final int RECORD_BODY_EMPTY = -6;
}
47. public class FileProcessor implements Constants {
private List readFile(String fileName) {
List lines = new ArrayList();
BufferedReader reader = null;
try {
reader = new BufferedReader(new FileReader(fileName));
String line;
while ((line = reader.readLine()) != null) {
lines.add(line);
}
} catch (FileNotFoundException ex) {
throw new SystemException(FILE_NOT_FOUND, ex);
} catch (IOException ex) {
throw new SystemException(FILE_READ_ERROR, ex);
} finally {
try {
if (reader != null) {
reader.close();
}
} catch (IOException ex) {
// この例外は無視する?
}
}
return lines;
}
}
48. public class FileProcessor implements Constants {
private List readFile(String fileName) {
List lines = new ArrayList();
BufferedReader reader = null;
try {
reader = new BufferedReader(new FileReader(fileName));
String line;
while ((line = reader.readLine()) != null) {
lines.add(line);
}
} catch (FileNotFoundException ex) {
throw new SystemException(FILE_NOT_FOUND, ex);
} catch (IOException ex) {
throw new SystemException(FILE_READ_ERROR, ex);
} finally {
try {
if (reader != null) {
reader.close();
}
} catch (IOException ex) {
// この例外は無視する?
}
}
return lines;
}
}
定数インタフェースという
優れたテクニック
定数クラス名を省略して
記載できるんですよ!