Distributed File System 1
Distributed file system in C
Loading...
Searching...
No Matches
testdb.c File Reference
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include "lib/uuid.h"
#include "lib/dnode.h"
#include "lib/inode.h"
#include "lib/block.h"
#include "lib/log.h"

Classes

struct  BlockAssoc
 Dummy data structure for database testing. More...
struct  BlockLocation
 Dummy datastructure for database testing. More...

Functions

ListDNode add_data_node (IPv4 address, Port port)
 Adds new data node to the metadata server Receives IP address and port I.E.
DNodecheck_node (IPv4 address, Port port)
 Check if node is in database and returns name, address, port for connection.
ListINode insert_file (SafeStr fname, size_t size)
 Create the inode attributes. For this project the name of the file and its size.
ListINode get_files (void)
 Returns the attributes of the files stored in the DFS: File Name and Size.
INodeget_file_info (SafeStr fname)
 Given a filename, if the file is stored in DFS return its filename id and fsize.
 DefList (BlockAssoc)
 DefList (BlockLocation)
BlockLocationInfoget_file_inode (SafeStr fname)
 Possibly gets the location information of a file.
int main (void)
 This will test the database.

Variables

 BlockLocationInfo

Function Documentation

◆ add_data_node()

ListDNode add_data_node ( IPv4 address,
Port port )

Adds new data node to the metadata server Receives IP address and port I.E.

the information to connect to the data node return self.c.lastrowid.

◆ check_node()

DNode * check_node ( IPv4 address,
Port port )

Check if node is in database and returns name, address, port for connection.

◆ DefList() [1/2]

DefList ( BlockAssoc )

◆ DefList() [2/2]

DefList ( BlockLocation )

◆ get_file_info()

INode * get_file_info ( SafeStr fname)

Given a filename, if the file is stored in DFS return its filename id and fsize.

Internal use only. Does not have to be accessed from the metadata server.

◆ get_file_inode()

BlockLocationInfo * get_file_inode ( SafeStr fname)

Possibly gets the location information of a file.

◆ get_files()

ListINode get_files ( void )

Returns the attributes of the files stored in the DFS: File Name and Size.

◆ insert_file()

ListINode insert_file ( SafeStr fname,
size_t size )

Create the inode attributes. For this project the name of the file and its size.

◆ main()

int main ( void )

This will test the database.

Variable Documentation

◆ BlockLocationInfo

BlockLocationInfo