Giter Site home page Giter Site logo

kalanadananjaya / distributed-content-search Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 3.0 15.41 MB

This repository contains the source code for a Distributed Peer to Peer Content Searching system built with unstructured overlay routing protocols

Java 98.23% Python 1.63% Makefile 0.14%

distributed-content-search's People

Contributors

heshanpadmasiri avatar kalanadananjaya avatar lahiruoshara avatar thameerahettiwatta avatar

Watchers

 avatar  avatar  avatar

distributed-content-search's Issues

Change the signature of download file

protected Future<FileDownloadResult> downloadFile(Node source, String fileName, String destination) {

Since paths for both normal download (= downloads by the user) (I assume this is local dir, otherwise let's add another parameter to the constructor called download dir) and the cache is already given in the constructor this public function which can be used to download files where needed is redundant. Instead, add two new protected functions one to download to the download dir (will be called when the user asks to download a file) and another to cache a file (will be called by the thread handling search requests received from other nodes), and remove this function from the protected interface.
I think the easiest way will be to make this function private and create two protected functions which will call this with the correct values for the destination

Required outputs for performance analysis

@heshanpadmasiri
These details are required for each node

  1. The following query message count
  • SER - the number of query messages received
  • FWD - the number of query messages forwarded
  • ANS - the number of query messages answered
    (better if it accumulates after every query)
  1. Latency and no of hops per query

The required format for latency and no of hops would be as follow after every query execution
"latency-4ms hops-5"

And a CLI command to get SER, FWD, ANS as follow
"SER-20 FWD-10 ANS-5"

Change the executor service

ExecutorService executorService = Executors.newSingleThreadScheduledExecutor();

It would be better if we don't create separate executor services for each function calls because it is expensive to create them. If possible move it to the constructor. (If we do this change the single thread executor to something like fixedThreadPool (if we have a reason to control the maximum number of parallel file download threads) or cachedThreadPool)

Replace all prints with loggers

I think it will be better if we can replace all the print statements with loggers (nothing fancy just use the java.util.logging.Logger) so all the outputs user sees are from the client application (Thameera's part). Otherwise, when we want to change the outputs we will have to check the entire project to find where the output came from.

Better if you can follow the same process I have used so we can easily find from where the log came from
https://github.com/heshanpadmasiri/distributed-content-search/blob/beb3d476c0d7f2c970d3232695dcca642b355057/src/main/java/com/distributed/p2pFileTransfer/Executor.java#L25

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.