Comments (3)
I'm a bit stuck on this. Here's the issue:
It would make sense to have an enum for job types, but our data exchange format is JSON. Since we want to serialize all this data to be able to recover in case the workers or the master are killed, we will be writing a bunch of JSON to hard drive - and I figured it would be nice if it was human-readable. Does this make sense?
Now let me elaborate with JSON-design issues:
Actually, I am not sure what JSON library to use. I looked at GSON and Jackson but I don't like that they lack some flexibility (what if a job has more attributes than just those defined in a class?), so I'm using json-minimal like you guys do in Cineast.
By using JsonObject as the internal representation, we end up with something that is easy to serialize, but it is a bit awkward at times (see the new Job class' getter methods).
If we used a JSON-POJO library it would make serialization easy and coding less awkward, but we might lose flexibility. What's your take on this?
P.S.: Sorry for the clumsy writing. I was on a rush. : ) Let me know if there are any problems.
from cthulhu.
I wouldn't use jsonobjects as internal storage objects but rather build a static serialize and deserialize method. The serialize function transform a job object into a json-encoded string while the deserialize method would be a factory creating job-objects from json-strings. I don't really see an issue with using an existing library like GSON or Jackson to do this...
The primary reason why cineast uses json-minimal was that it was easy to extend the parser in order to add an additional stop symbol ';' so it would return when reading from a stream without the stream having to be closed. I also quite like the API...
from cthulhu.
Alright! I've switched to GSON for Job creation. I solved the 'flexibility' problem by creating a custom serializer/deserializer so that each job type can be serialized/deserialized properly. Job type will take the name of the classes (e.g. "BashJob", "FeatureExtractionJob", "Job", etc.)
from cthulhu.
Related Issues (20)
- UI for the master has external dependencies
- deleteJob with force must stop job if it's running HOT 1
- worker dealing with failed coordinator connection HOT 1
- Need ability to interrupt jobs HOT 1
- Only Worker process can `put job` HOT 2
- `WorkerScheduler.finalizeJobExecution` should be debugged closely to make sure no bugs exist
- When a job is deleted, the schedulerTick() function is not called anymore
- Should switch from `Hashtable` to `ConcurrentHashMap` HOT 1
- Coordinator should inform worker when it's deleted
- serve static files from within jar HOT 2
- Can JobComparator class be made static? HOT 1
- Coordinator restore should be thoroughly tested HOT 2
- IPv6 address not used by Scheduler
- package names
- JobFactory does not handle job creation error
- visibility of default constructors in Job
- Job status codes HOT 1
- MasterScheduler.deleteJob HOT 1
- Job requirements
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cthulhu.